Results 1 to 6 of 6
  1. #1

    dating site performance issue

    Hi everyone

    we've got 3 servers :

    1. PHP Codes (symfony framework)
    4GB Ram
    2 X Dual Core Xeon(TM) CPU 3.20GHz

    using apache2.0.58 & php 5.1.2

    2. Images & Videos (file server)
    2 GB Ram
    2 x Intel(R) Xeon(TM) CPU 2.80GHz

    only apache 2.0.58

    3. Mysql DB Server
    2 GB Ram
    2 x Intel(R) Xeon(TM) CPU 2.80GHz

    mysql5 and apache2 (for static images)

    100 MBps bandwidth

    our httpd.conf like that :

    Timeout 50
    KeepAlive Off
    MaxKeepAliveRequests 0
    KeepAliveTimeout 5

    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule worker.c>
    StartServers 64
    MaxClients 80000
    MinSpareThreads 128
    MaxSpareThreads 2048
    ThreadsPerChild 0
    MaxRequestsPerChild 1000

    other MPM modules has disabled. and this apache using mod_deflate for content compression.

    2.server has mounted with samba to first one for writng media files (images,videos) and site read from there.

    we've got 300 - 500 per/sec. unique visitors. all visitors firstly using 1. server. but when we reached high visitors count server has high load and site is very slow.

    other servers has not high load but first one dying.

    where's the problem ??

    u guys have any idea..

    thanx a lot

  2. #2
    Join Date
    May 2006
    Teh Interweb
    I would have to suggest the obvious here and say that you probably need a load balancer and multiple webservers. This way the load of 300 unique visitors per second (which is massive by the way) can be spread out amongst multiple servers. The file server and mysql server should be fine like you say but you need some help on the front end.

    In my experience, it is best to have an array of webservers all connecting back to a hefty sql server and one or two massive disk arrays over NFS. All of this behind a redundant firewall/load balancer.

    [[email protected]] ~ $ cat .signature
    cat: .signature: No such file or directory

  3. #3
    Join Date
    Oct 2002
    Don't use apache for serving the images/video. Switch to Lighttpd or another event based web server. You need to do additional load testing to find out where the problem is. Show us the top results for each serving when they are being maxed out.
    The World's first server mating experiment
    We give new meaning to I/O intensive and hot swap

  4. #4
    Join Date
    Nov 2005
    London UK
    <IfModule worker.c>
    StartServers 64
    MaxClients 80000
    MinSpareThreads 128
    MaxSpareThreads 2048
    ThreadsPerChild 0
    MaxRequestsPerChild 1000

    You don't have enough memory for 80,000 maxclients, or 2048 spare threads.
    Increase MaxRequestsPerChild to 10,000+.

    And move to prefork.
    UK SSD VPS without compromise - upto 250k IOPS !

  5. #5
    can u post apache settings which we need and why prefork ?

    some forums says use worker because it's uses less mem.

  6. #6
    Join Date
    Nov 2006
    College Station, TX
    Worker has issues on Linux -- that's the main point. It's very heavily not reccomended for use with PHP, which is only somewhat thread-safe. You'll see all kinds of Weird Things (tm) happen, including runaway processes.

    So... diagnosing the problem -- you need to figure out where your constraint is first. Theoretically you should be able to serve a lot of clients with your setup. But... What's your top look like? What's your keepalive set to in apache? Are you using all of your memory and getting into swap, which will kill your performance no matter what? How many apache processes are running once you switch back to prefork?

    Second -- why do you have the 2nd server mounted via Samba? Are you serving images and movies off of the 2nd server, or are people uploading them to server 1 and then they get transferred to server 2? Instead of using smb, which is a pretty expensive service to be running, have you looked at nfs (better, but still not great) or php's ftp modules (best) to transfer the images?

    Third -- You're using symfony, right? Have you toyed with the cache settings? Symfony's a pretty heavy framework if you're regenerating pages with every push, but if you're using the caching intelligently you can reduce load dramatically.

    What version of symfony are you using? If you're using .63, the reason they're getting away from XML is that it's expensive (processor-wise) to parse. You might see what your app looks like in 1.0-beta1 ... it's not quite production-safe yet, but there's plenty of workarounds for what's broken. The switch to yml for schema is *nice*.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts