1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Max Connections Issue [URGENT]

Discussion in 'Apache' started by scottmweaver, Jun 8, 2010.

  1. #1
    Hey guys,

    I run Blogflare.com which is experiencing issues with connection overload. Here are the server details:

    OS: Ubuntu Linux 8.04.3
    Processor: Intel(R) Core(TM)2 CPU X6800 @ 2.93GHz, 2 cores
    Memory: 2GB
    HDD: 250GB
    Web: Apache version 2.2.8

    Blogflare has a small image (~300 bytes) that gets called from each blog in order to collect statistics. The image is really a PHP script that simply stores the hit in MySQL and spits out a cached image. Then every 10 minutes or so, ranks are recalculated using MySQL and the hits table is emptied. The process starts all over again.

    The current problem is that there are just too many sites calling the tiny image/script at once and I have maxed out at the MaxClients limit (250). I know for certain it's this script because I've tracked it and when I shut it down, the problem goes away.

    I thought of potentially removing MySQL from the data collecting loop by just storing the hits and ranks to text files every time ranks are calculated (every 10 minutes), but this still leaves the connections issue on the table.

    I looked into potentially using a CDN but I want to keep this as cheap as possible. I'm not sure how I could use a service like, say, Amazon's S3 and still collect statistics properly.

    Any help is greatly appreciated.

    Thanks,
    Scott
     
    scottmweaver, Jun 8, 2010 IP
  2. raffo77

    raffo77 Active Member

    Messages:
    234
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    Hi Scott,

    I suggest you to install cband and mod_qos on you Apache configuration.
    Also install a Girewall like CSF or APF and filter SYN connection..

    I suggest to upgrade your RAM becouse all security software charge more data in the memory..

    If you want i'm disponible to help you, i can also provide a mirroring for your images.

    RAFFAELE
     
    raffo77, Jun 8, 2010 IP