slow webserver when many users are online

Posted on 2004-09-02
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

Question by:wiceman
  • 3
  • 3
LVL 15

Expert Comment

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?


Author Comment

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

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

  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.


LVL 15

Expert Comment

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.

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.


Author Comment

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?
LVL 15

Accepted Solution

samri earned 500 total points
ID: 12019766

Author Comment

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

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

939 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now