Subscribe to Dream.In.Code Team Blog        RSS Feed
-----

Dream.In.Code Code & Server Improvements Save 58 Man Hours/Day

Icon 17 Comments
Over the last few months, I've noticed pages have taken longer to load than I would like and the past few weeks have been especially slow. I decided to get to the bottom of things and over the last week or so I've been doing some heavy modifications to the server and code base in the weeeee hours of the morning. Let me share with you what all I've done and the results:

  • Installed and optimized stable version of Google's new mod_pagespeed for Apache. This module strips whitespace, comments, and performs other optimizations to CSS, Javascript, and images in real time. This improves how quickly your browser can render pages.
  • Moved PHP from the apache2handler to mod_fcgi (FastCGI) to take advantage of improved performance and lower overhead.
  • Tuned Apache even further by adjusting mod_deflate, logging, keep-alive, and other settings to ensure there are no bottlenecks within Apache
  • Cached several additional queries in memcache that were running each time a page loaded
  • Removed several extraneous queries and pieces of code that were redundant or not optimized properly (this was the biggy)
  • Adjusted PHP and Forum software settings to eliminate redundant compression and match output buffering to packet size
  • Adjusted priority of backup scripts to prevent slowdowns in the evening hours (still testing to see if this is in fact working as planned)
  • Edited several hundred lines of code to remove standards violations and work toward having 100% standards compliant code


There are still many improvements and optimizations I will continue to explore to the database and code, but here are the results:

  • Prior to changes: Time-To-First-Byte (the time your browser says "waiting for www.dreamincode.net") was over 2,500ms (2.5+ Seconds)
  • After Improvements: Time-To-First-Byte is now less than 750ms, and improvement of over 1.5 seconds per page load.
  • If you add up the 1.5 second improvement per page view, across 140,000 page views/day, it equals 58 man hours saved each day not waiting for pages to load.
  • The load on our 4 processor, 16 core, 12GB of RAM web server went from 8-10 (Max is 16) to 2-4.


And like most changes... I kick myself for not having done it years ago :) Hope you enjoy the faster page loads!

P.S. The blogs have been fixed so that javascript functionality works as designed. Things like "Comment Notifications" and dragging/dropping your blog sidebar boxes now work.

P.P.S I changed the "View New Posts" to "Today's Topics" as one of the major bottlenecks we saw was long time members with 50,000 unread posts clicking "View New Posts" and the query taking 5+ seconds. "Today's Topics" is essentially the same view, but only pulls back the last 24 hours worth of topics/posts. "View New Posts" is still available from the "My Profile/Account" drop down menu.

tl:dr - Shit's faster, enjoy!

17 Comments On This Entry

Page 1 of 1

Sethro117 Icon

22 January 2011 - 03:37 PM
I have noticed it being faster. Yesterday it was lagging a bit and I was having some connection issue but since then it's been great. Great job Chris!
0

Gorian Icon

22 January 2011 - 03:41 PM
Sweet!
0

mostyfriedman Icon

22 January 2011 - 04:35 PM
You see??, this is why we need the study of algorithms, to make things faster :P
2

Martyr2 Icon

22 January 2011 - 05:21 PM
I am seriously impressed! I clicked the "Todays topics" item at the top and saw the page load in like half a second. So fast that I had to stop and say "Did it give me the latest topics or am I on cache?" and so I clicked it again. When it reloaded I was like "Damn! Now that is improvement!"

Great work Chris! :)
1

EnvXOwner Icon

22 January 2011 - 05:23 PM
Good job, Chris! I'm glad that I'm able to access the site faster even though I'm on my neighbors crappy wifi! lol
0

skyhawk133 Icon

22 January 2011 - 05:26 PM

Martyr2, on 22 January 2011 - 05:21 PM, said:

I am seriously impressed! I clicked the "Todays topics" item at the top and saw the page load in like half a second. So fast that I had to stop and say "Did it give me the latest topics or am I on cache?" and so I clicked it again. When it reloaded I was like "Damn! Now that is improvement!"

Great work Chris! :)


Huzzzah! I was thinking of you when I made that change ;)
0

EnvXOwner Icon

22 January 2011 - 05:33 PM
Good job, Chris! I'm glad that I'm able to access the site faster even though I'm on my neighbors crappy wifi! lol
0

Sergio Tapia Icon

22 January 2011 - 06:22 PM
I have to say I haven't noticed the site being slow at all, but this improvement sounds great! Excellent work! :D DIC is the best site on the web.
0

eker676 Icon

22 January 2011 - 07:16 PM
I have noticed the lag when you are first trying to load a topic, post, etc.

So far it's looking quite snappy. Nice Job!
0

Valek Icon

23 January 2011 - 04:12 AM
The improvements are very helpful when I'm accessing DIC from work. Thank you!
0

BenignDesign Icon

23 January 2011 - 07:28 AM
You rock my socks, Chris! Whee!
0

n8wxs Icon

23 January 2011 - 03:58 PM
Yes!!! :)
0

Tryparse Icon

24 January 2011 - 03:56 PM
Soooo much faster .. excellent work!
0

no2pencil Icon

24 January 2011 - 07:53 PM
Thank you for the tldr summary. Talk about faster...
0

Locke Icon

25 January 2011 - 11:28 AM
I was hoping there was a tl;dr at the bottom, and knowing our good ol' boss, there was.
0

Jstall Icon

27 January 2011 - 05:28 PM
Awesome! I find the change very noticeable, general browsing is much faster. Now I can sneak D.I.C visits in at work more efficiently :P thanks much!
0

anonymous26 Icon

29 January 2011 - 04:08 PM
Nice one! was wondering what was happening with the site performance. :)
0
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

стальная обрешетка стеновые панели сэндвич промышленное здание from стальная обрешетка стеновые панели сэндвич промышленное здание

Tracked on Oct 17 2014 02:15 PM

October 2014

S M T W T F S
   1234
567891011
12131415161718
1920212223 24 25
262728293031 

Recent Entries

Recent Comments

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)