WEB 760K+ uniques (65+ million pageviews) in the last 30 days

Discussion in 'OT Technology' started by Drowned, Jan 27, 2010.

  1. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    Server can't take it anymore... it's a 9650 Quad-Core Phenom / 8GB Ram... load average is about 15-20 right now.

    What's the hotness on servers right now? Intel i7? Any great offers out there? :x:

    I need unmetered 100mbit and location = outside the US :wtc: and I wouldn't mind for it to be managed :wiggle:
     
  2. Tony Stark

    Tony Stark John McCain has an illegitimate mexican baby

    Joined:
    Jun 27, 2003
    Messages:
    40,060
    Likes Received:
    0
    all that for that spanish car forum?
     
  3. pharmokan

    pharmokan OT Supporter

    Joined:
    Oct 18, 2002
    Messages:
    102,084
    Likes Received:
    402
    Location:
    L.A.
    ITS LEOPARD HOLMES!
     
  4. Yahdude

    Yahdude New Member

    Joined:
    Jun 21, 2006
    Messages:
    1,211
    Likes Received:
    0
    Location:
    PC, UT
    more memory
     
  5. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    split your db and web servers up... go SCSI or SSD for hard drives.
     
  6. XO

    XO bee a honey

    Joined:
    Oct 5, 2001
    Messages:
    37,079
    Likes Received:
    49
    Location:
    Not*Cal
    split them up for sure, but it's going to cost money

    make sure you're running apc or some sort of php accelerator

    might want to double check your mysql settings too, set a query cache size and stuff
     
  7. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    What are you hosting? What is your current server setup (in terms of software)? What is causing the most load at the moment? (show some example top output)

    Tweak Apache, or dump Apache entirely - try Nginx or Lightspeed.

    Tweak php.ini - don't load modules you're not using. Make sure you're running PHP as DSO, and not under suphp or suexec or similar.

    Use an opcode cache like APC or similar.

    If you're a database driven site, take a look at your database load. If you're running lots of selects on a certain column, make sure the column has an index. Are you getting any database locking? Look at tweaking your my.cnf - take a look at your query caches and similar. Perhaps look at using memcached.
     
  8. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    If you want to get a new server after looking at all of those, look at the netherlands for plentiful and cheap bandwidth. :)
     
  9. pharmokan

    pharmokan OT Supporter

    Joined:
    Oct 18, 2002
    Messages:
    102,084
    Likes Received:
    402
    Location:
    L.A.
    wait what do you mean when you say load average

    are you combining cpu mem when you say 15-20

    because u know your quad core is out of 400 not 100 right
     
  10. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
  11. pharmokan

    pharmokan OT Supporter

    Joined:
    Oct 18, 2002
    Messages:
    102,084
    Likes Received:
    402
    Location:
    L.A.
  12. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    Is your load average high? :o

    Or rather, do you have a big load? :naughty: :greddy:
     
  13. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    Nope, a jailbait site...
     
  14. pharmokan

    pharmokan OT Supporter

    Joined:
    Oct 18, 2002
    Messages:
    102,084
    Likes Received:
    402
    Location:
    L.A.
    i see my cpu load shoot past 100 occasionally :naughty:
     
  15. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    Just one site with custom software... a gallery I developed that I've optimized for a long time now.

    I really need to do this. After some apache tweaing I was able to drop the load to around 3-5 average which is not that bad IMO but it climps from time to time to around 30. I need to check my crons cause it happens around every 5 minutes.

    I still need to get rid of apache. I also need some kind of accelerator... I had one but it was caching too much and pages didn't get updated, LOL. Bad setup I guess... I'll work on that, thanks for the suggestions :)
     
  16. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    Code:
    top - 19:05:13 up 125 days,  6:13,  1 user,  load average: 9.37, 10.61, 9.14
    Tasks: 661 total,   2 running, 658 sleeping,   0 stopped,   1 zombie
    Cpu0  :  0.0%us, 17.1%sy, 50.0%ni, 21.7%id, 10.7%wa,  0.0%hi,  0.5%si,  0.0%st
    Cpu1  :  0.0%us, 15.2%sy, 40.0%ni, 38.1%id,  5.9%wa,  0.0%hi,  0.8%si,  0.0%st
    Cpu2  :  0.0%us, 15.2%sy, 46.5%ni, 37.4%id,  0.8%wa,  0.0%hi,  0.0%si,  0.0%st
    Cpu3  :  0.0%us,  9.1%sy, 54.8%ni, 18.2%id,  7.2%wa,  0.3%hi, 10.4%si,  0.0%st
    Mem:   8280040k total,  7989696k used,   290344k free,   138848k buffers
    Swap: 16783892k total,       84k used, 16783808k free,  5363804k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    31167 mysql     26   6  887m 356m 3892 S 95.4  4.4 299:37.79 mysqld
     9478 nobody    24   4  290m  20m 5204 S  3.3  0.2   0:00.42 httpd
     9860 nobody    24   4  291m  19m 5048 S  2.2  0.2   0:00.28 httpd
     9357 nobody    24   4  291m  20m 5352 S  1.7  0.2   0:00.40 httpd
     9358 nobody    24   4  291m  20m 5328 S  1.7  0.2   0:00.34 httpd
     9366 nobody    24   4  292m  21m 5172 S  1.7  0.3   0:00.48 httpd
     9369 nobody    24   4  291m  20m 5376 D  1.7  0.3   0:00.58 httpd
     9443 nobody    24   4  291m  19m 5184 S  1.7  0.2   0:00.36 httpd
     9601 nobody    24   4  291m  20m 5264 D  1.7  0.2   0:00.30 httpd
     9724 nobody    24   4  291m  19m 4980 D  1.7  0.2   0:00.30 httpd
     9940 nobody    24   4  290m  19m 5312 D  1.7  0.2   0:00.38 httpd
     9374 nobody    24   4  291m  20m 5224 D  1.1  0.2   0:00.26 httpd
     9382 nobody    24   4  291m  20m 5488 D  1.1  0.3   0:00.46 httpd
     9386 nobody    24   4  290m  20m 5208 S  1.1  0.2   0:00.34 httpd
     9387 nobody    24   4  291m  19m 5100 S  1.1  0.2   0:00.42 httpd
     9408 nobody    24   4  291m  19m 5112 D  1.1  0.2   0:00.32 httpd
     9409 nobody    24   4  291m  20m 5216 S  1.1  0.2   0:00.34 httpd
     9419 nobody    24   4  291m  19m 5128 D  1.1  0.2   0:00.44 httpd
     9471 nobody    24   4  291m  20m 5380 D  1.1  0.2   0:00.38 httpd
     9485 nobody    24   4  291m  20m 5344 S  1.1  0.2   0:00.38 httpd
     9488 nobody    24   4  295m  24m 5296 S  1.1  0.3   0:00.30 httpd
     9494 nobody    24   4  291m  20m 5268 D  1.1  0.2   0:00.44 httpd
     9509 nobody    24   4  291m  20m 5312 D  1.1  0.2   0:00.32 httpd
     9511 nobody    24   4  291m  19m 5052 S  1.1  0.2   0:00.34 httpd
     9520 nobody    24   4  291m  19m 5136 D  1.1  0.2   0:00.30 httpd
     9526 nobody    24   4  291m  20m 5236 S  1.1  0.2   0:00.24 httpd
     9527 nobody    24   4  290m  19m 5208 S  1.1  0.2   0:00.36 httpd
     9531 nobody    24   4  291m  20m 5248 S  1.1  0.2   0:00.38 httpd
     9542 nobody    24   4  290m  19m 5228 S  1.1  0.2   0:00.30 httpd
     9546 nobody    24   4  291m  20m 5260 D  1.1  0.2   0:00.36 httpd
     9559 nobody    24   4  291m  19m 5028 S  1.1  0.2   0:00.32 httpd
     9568 nobody    24   4  290m  19m 5192 D  1.1  0.2   0:00.28 httpd
     9609 nobody    24   4  290m  18m 4212 S  1.1  0.2   0:00.20 httpd
     9615 nobody    24   4  291m  20m 5208 D  1.1  0.2   0:00.34 httpd
     9627 nobody    24   4  291m  19m 5100 S  1.1  0.2   0:00.28 httpd
     9635 nobody    24   4  291m  19m 5120 S  1.1  0.2   0:00.24 httpd
     9639 nobody    24   4  291m  19m 5140 S  1.1  0.2   0:00.38 httpd
     9657 nobody    24   4  291m  20m 5312 D  1.1  0.2   0:00.46 httpd
     9672 nobody    24   4  291m  19m 5112 S  1.1  0.2   0:00.20 httpd
     9713 nobody    24   4  290m  19m 5140 S  1.1  0.2   0:00.30 httpd
     9720 nobody    24   4  291m  19m 4960 S  1.1  0.2   0:00.18 httpd
     9734 nobody    24   4  291m  19m 5144 S  1.1  0.2   0:00.40 httpd
     9780 nobody    24   4  291m  20m 5304 S  1.1  0.2   0:00.34 httpd
     9786 nobody    24   4  291m  20m 5308 D  1.1  0.2   0:00.34 httpd
     9821 nobody    24   4  291m  19m 5144 S  1.1  0.2   0:00.26 httpd
     9839 nobody    24   4  291m  19m 5040 D  1.1  0.2   0:00.26 httpd
     9881 nobody    24   4  291m  19m 5140 S  1.1  0.2   0:00.28 httpd
     9894 nobody    24   4  291m  20m 5224 S  1.1  0.2   0:00.28 httpd
     9904 nobody    24   4  291m  19m 5064 S  1.1  0.2   0:00.30 httpd
     9909 nobody    24   4  291m  19m 4980 D  1.1  0.2   0:00.28 httpd
     9912 nobody    24   4  291m  19m 5080 D  1.1  0.2   0:00.32 httpd
    
    Top, I guess mysql needs some tuning :p I hate adding indexes... I almost got rid of all my slow queries the last time I did it... let's see what's going on this time...
     
  17. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    Have a look at your mysql process list for 15 minutes or so, just keep hitting it and check to see which queries you see sitting around for longest. You might have a locking issue or similar. :)

    One other thing to think about is caching. At the very least, I hope you're not redrawing thumbnails and the like for each page load :o At the very most, you could probably cache every page load, and rebuild galleries from php/database every minute or so. So instead of being hammered dozens of times a second, your server will mainly be serving static content.
     
  18. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    Nah, If I was generating thumbs I would've killed the server a long time ago ;) Yeah, I was thinking of saving pages in xml format... I already do it for comments and only update the xml when somebody comments... I guess I could do the same for the whole page :dunno:
     
  19. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    I think if you can get nginx up and running nicely and MySQL tweaked, you'll be sorted. :cool:

    Edit: that said, I imagine you're making money from your site for it to be this popular - or if you're not, you should be. If the site is important to you, it might be an idea to start thinking about high availability solutions at some point once you start needing a more powerful machine. Or at least some kind of plan for server or network failure or similar. Even if it's a case of rsyncing everything regularly to another server, and having that server just serve static content if the main server goes down (with DNS failover), it's something to think about, anyway.
     
  20. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    you have mysql cache on?
     
  21. 2ofdem

    2ofdem OT Supporter

    Joined:
    Jun 17, 2003
    Messages:
    114,853
    Likes Received:
    8
    Location:
    aus.vic.mel
    litehttpd and some php caching and acceleration will get it running sweet but you really need a dedicated DB server and maybe a pair of web servers.
     
  22. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    what do you guys cluster with? I've only done LVM & apache setups...
     
  23. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    HAproxy or Nginx are both excellent load balancers... but how to handle file replication is another thing really. Clustering past having a single dedicated web server and dedicated MySQL server gets very complicated. Atomicity probably isn't a big deal with this kind of site, so a simple rsync between servers should be simple enough, however he would need to make sure that file names on each server are unique for uploaded files etc...

    Pretty sure we already knew that :hsugh:
     
  24. CodeX

    CodeX Guest

    More memory.

    You need enough memory to fit your entire site and user database.
     
  25. dazmanultra

    dazmanultra New Member

    Joined:
    Jun 17, 2002
    Messages:
    34,795
    Likes Received:
    0
    Location:
    English Countryside
    Woah dude, calm down it's not like i insulted your mum :wtf: :rofl:
     

Share This Page