Go Premium for a chance to win a PS4. Enter to Win


slow webserver when many users are online

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

926 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