Solved

slow webserver when many users are online

Posted on 2004-09-02
6
522 Views
Last Modified: 2008-03-06
Hi i have an image displaying page.
I got two dedicated servers with default plesk installation on both.

in one i installed a virtual host thru plesk (server 1) with the php files in it.
in the other one i installed another virtual host (with a fake domain name)and added a database(also thru plesk), so server 1 can use that database.

Im a neewbie in linux/apache, and that was the only way i could set up my site for it to work.

Now, The problem is that when there are more than about 60 users online the page takes minimal 60 seconds to load.. thats pretty much.

When using opera webbrowser you can see how the client comunicates with the server, there i can see that sending the request to the webserver takes about 40 seconds..

also i have added another virtual host in server 1 that got nothing to do with the one im having problems with, but i yust added this here to let you know that when entering that domain even though the other page is slow this one downloas in seconds. (exact same php script)  

Is there anything i can do in the apache configuratuion to solve this problem?

server1 (dual 2.8ghz 500mb ram) plesk 6
server2 (2.8 ghz 1000mb ram) plesk 7

0
Comment
Question by:wiceman
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:samri
ID: 11971770
the slowness sounds normal.

What is your bandwith to the internet?

60 users concurrent, and each browse window may be using multiple connection to the server.  Imagine if you are visitng a website with 10 picture, and several of them would be loaded at the same time.  So it may contribute to the slowness.  Wost case, if everybody if trying to load different picture.  Disk IO would be expensive.  Not to mention web-crawler, leechers, image thief? etc. etc.

Monitor your bandwith? and perhaps the server CPU and Disk utilization to get a better picture.  

Pleask to my understanding is a virtual-server concept.  Do you know who are you sharing the physical machine with?  And what they are doing - in term of server/wan utilization?

Cheers,
0
 

Author Comment

by:wiceman
ID: 11976193
hi again.

acording to my server provider the dedicated servers are on a 100Mb switch.
Is there a way to test it?

I did a "top" from shell on both servers here are a sample:

server 1

151 processes: 149 sleeping, 1 running, 1 zombie, 0 stopped
CPU0 states:   2.0% user   8.1% system    0.0% nice   0.0% iowait  88.1% idle
CPU1 states:   4.0% user   4.1% system    0.0% nice   0.0% iowait  90.1% idle
Mem:   512680k av,  474652k used,   38028k free,       0k shrd,  122636k buff
                    318892k actv,   60584k in_d,    8036k in_c
Swap: 1052216k av,   25756k used, 1026460k free                  172004k cached

  PID   USER     PRI  NI  SIZE   RSS  SHARE   STAT  %CPU %MEM   TIME CPU COMMAND
23298 root      15    0    3064  360   240       S         2.9     0.0        0:49  1     httpd
27880 apache  15    0    0       0       0          Z         0.9     0.0        0:00  1     httpd <defunct>
13100 root      15    0    948    916   496       R         0.4     0.1        0:55  1     top
28126 root      20    0    444    444   384       S         0.4     0.0        0:00  0     tcp-env

Server 2

 02:36:27  up 6 days, 18:26,  1 user,  load average: 18.70, 16.04, 15.40
72 processes: 65 sleeping, 2 running, 5 zombie, 0 stopped
CPU0 states:  90.1% user   9.3% system    0.0% nice   0.0% iowait   0.0% idle
CPU1 states:  88.3% user  11.1% system    0.0% nice   0.0% iowait   0.0% idle
Mem:  1021448k av, 1005496k used,   15952k free,       0k shrd,  140208k buff
                    516480k actv,       0k in_d,   20764k in_c
Swap: 2096472k av,    3052k used, 2093420k free                  737988k cached

  PID     USER    PRI  NI  SIZE    RSS   SHARE STAT %CPU %MEM   TIME      CPU COMMAND
  27557 mysql    17   0   25800  25M   2420    R       99.9   2.5         550:21   1     mysqld
  27577 root      16   0    1180   1180  868      R       0.3     0.1        1:16       1     top
  1        root      15   0    108     100    56       S       0.0     0.0         0:21      1     init
  2        root      RT   0    0        0        0        SW    0.0     0.0         0:00       0    migration/0
  3        root      RT   0    0        0        0        SW    0.0     0.0         0:00      1     migration/1


The CPU usage for mysqld process on server 2 is allways on 99.9%
I guess thats whats causing the delay?

Any suggestions/thougths.

Thanks

0
 
LVL 15

Expert Comment

by:samri
ID: 11980490
100Mb swith is your connection to the LAN, but how about the WAN bandwith.  It is very common to be on 100Mb LAN or even some would be on Gigabit connection.

I would agree with you on the mysqld process.  Perhaps you may want to pay closer attention to it.

Server1, appears to be swapping quite a bit compared to Server2.

Swap: 1052216k av,   25756k used, 1026460k free                  172004k cached

You may want to stop mysql and test the performance (just to ensure that mqsql is hogging the machine) -- if you could afford to.

cheesr.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:wiceman
ID: 12018628
I have no idea what the WAN bandwith is.

Server 2 is only working on the database, maybe thats why it only uses little swap space..

Which files do i need to modify to optimise mysql?
0
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 12019766
0
 

Author Comment

by:wiceman
ID: 12022232
The problem was som poor code..  the code i had was written for about three years ago..
I changed my mysql queries completly with the new features of mysql, i managed to remove about 6 queries.
now it works ten times as fast.


Thanks anyway
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question