Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

slow webserver when many users are online

Posted on 2004-09-02
6
523 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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