The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

High server load - 1 web site - PERL/MySQL Please Help

Discussion in 'Workarounds and Optimization' started by McShark, Mar 20, 2010.

  1. McShark

    McShark Registered

    Joined:
    Mar 20, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi Everyone,

    I have a web site with 11,000 UV daily

    the dedicated details :
    - Opteron 1218 HE 2 x 2,6 GHz.
    - 4 Go RAM.
    - 100 Mbps Speed.

    i installed WHM/Cpanel, i don't need to run an other web site in this server.

    the web site hosted require only :

    - Apache web server.
    - Perl higher than 5.007 version.
    - MySQL database.
    - Apache mod_rewrite module.
    - .htaccess files support.
    - DBI, DBD::mysql perl modules.
    - LWP Bundle.

    what services can be disabled to save CPU usage ?, the current CPU usage is 98%.

    the web site load very very slow, there are any perl module to speed up perl execution ?

    Please help with your experience.

    Thanks in advance.
     
  2. mohit

    mohit Well-Known Member

    Joined:
    Jul 12, 2005
    Messages:
    553
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sticky On Internet
    it should run smoothly if the server is configured/secured properly.

    what does TOP show when you see that 98%cpu load ?

    if you have shell access top output can be helpful in finding whats eating your cpu.
     
  3. McShark

    McShark Registered

    Joined:
    Mar 20, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    518 root 11 -5 0 0 0 R 35.9 0.0 374:07.00 md7_raid1
    7645 root 10 -5 0 0 0 D 7.6 0.0 18:04.84 md7_resync
    1011 nobody 20 0 70620 2832 776 S 0.3 0.1 0:01.20 httpd
    1023 nobody 16 0 129m 4692 1796 S 0.3 0.1 0:00.20 httpd
    1064 nobody 15 0 366m 8120 1832 S 0.3 0.2 0:01.13 httpd
    3536 root 18 0 12740 1284 936 R 0.3 0.0 0:00.10 top
    1 root 15 0 10348 752 632 S 0.0 0.0 0:10.99 init
    2 root RT -5 0 0 0 S 0.0 0.0 0:00.77 migration/0
    3 root 34 19 0 0 0 S 0.0 0.0 0:07.81 ksoftirqd/0
    4 root RT -5 0 0 0 S 0.0 0.0 0:00.01 watchdog/0
    5 root RT -5 0 0 0 S 0.0 0.0 0:00.67 migration/1
    6 root 34 19 0 0 0 S 0.0 0.0 0:13.36 ksoftirqd/1
    7 root RT -5 0 0 0 S 0.0 0.0 0:00.09 watchdog/1
    8 root 10 -5 0 0 0 S 0.0 0.0 3:16.96 events/0
    9 root 10 -5 0 0 0 S 0.0 0.0 2:47.99 events/1
    10 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 khelper
    48 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
    53 root 10 -5 0 0 0 S 0.0 0.0 0:07.62 kblockd/0
    54 root 10 -5 0 0 0 S 0.0 0.0 0:00.48 kblockd/1
    55 root 14 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
    212 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
    213 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/1
    216 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
    218 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
    294 root 15 0 0 0 0 S 0.0 0.0 2:34.59 pdflush
    295 root 15 0 0 0 0 S 0.0 0.0 3:51.87 pdflush
    296 root 10 -5 0 0 0 S 0.0 0.0 26:44.36 kswapd0
    297 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
    298 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 aio/1
    440 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
    473 root 16 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
    474 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 ata/1
    475 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
    479 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
    480 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
    481 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
    482 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_3
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Well the very thing I see right away is your memory and network card is grossly too low if those visitors are in any way like normal average visits to sites and that goes double if you are running some kind of forum site.

    I would look at 8 GB though if you are making database calls from Perl scripts (Eww! by the way -- not resource friendly) then you might even want to look more at something like 12 GB for that.

    Your processor might work but make sure you enable all the cores and set the proper concurrency levels in both the operating system and also in your database. The default is to use 1 single core so you end up showing you have all these cores that aren't actually being used any.

    Beyond that, you will want to take a very hard look at your settings and optimizations of the configuration of your server and applications and that is really very much a whole field and science in itself and being the scope of what I can reasonably sit here and type in a post other than giving you a few helpful tips but there is quite literally hundreds of different areas you will want to review in your server if you are going to be thorough and complete about performance tuning your server.

    With that said, is those 11,000 unique visitors scattered evenly around the clock or are you getting enormous bursts of visitors at certain times because if it is the latter, there may be little you could do though you might try a caching reverse proxy but in that situation, you would probably gain greater benefit from a load balancing cluster type configuration between multiple server machines.

    Another avenue you might look at is off loading your database to an external server IN THE SAME DATA CENTER on another machine and setting up a local private network between the machines as this is also another means of substantially increasing performance especially with it appearing you are making your mysql calls via Perl scripts.
     
Loading...

Share This Page