Share
Embed
Why Open Source is Sulit
Presented at Software Freedom Day 2012 in Cebu City.
sulittech
September 15, 2012
Transcript
18 slides
-
Why Open Source is Sulit (and vice versa) Eric Bangug
and Mica Diaz de Rivera Presented by: -
In the Beginning RJ, why not create a classifieds ads
website? OK, Arianne! I'll start coding. We can use Open Source Software. Yay! * Conversations and thought bubbles in this presentation are 56.7890% accurate. 6 years ago a young woman in her early to mid 20’s threw her boyfriend an idea – a classified ads website for Filipinos and by Filipinos. Her boyfriend, who is almost the same age as her, thought it was a great idea and went to coding right away. -
RJ David Diaries Early lessons learned from running a high
traffic website Welcome to my home office. This used to be the Sulit.com.ph main headquarters. Get your tissues (for nose bleed) and thinking caps ready! The following slides will be very ... INFORMATIVE. -
Use Opcode Caching • “I can't think of any reason
why you should not use opcode caching (unless you cannot install it in a shared host). It can execute 5-10 times faster as compared with normal PHP processing.” -
Don't use Apache for serving static files • “Apache process
consumes a lot of resources and using it to serve static files is overkill especially if you set apache to serve PHP with all the needed extensions.” -
Use 64bit Linux to utilize more RAM in a server
• “I've been too lazy to upgrade my system to 64bit and I was stuck with a system that cannot even effectively use the entire 4GB RAM of my server.” -
Cache as much as you can • “The cache ensures
that I am not hitting the database more than once asking for the same information as before.” -
When using cache, avoid a remove/delete function • “During update,
instead of deleting the cached data, access the database for the new data and then overwrite the cache (if using file- based caching, remember to lock the file before overwriting it so that the other connections trying to read from the file will wait for a moment and will not get a corrupted cache file and will end up hitting the database).” -
Avoid time-based caching functionality • “Most Cache classes available offer
a time- based caching functionality (e.g. cache will return the data if within the given duration else will return null or false). Avoid using this functionality as it will result to the same problem above (i.e. too many connections hitting the database when the cache expires).” -
For full-text search, do not rely on MySQL alone •
“I ended up discovering sphinxsearch (indexing application similar to lucene). Using this with MySQL, those complex queries can be completed to as fast as 0.01 second.” -
Use Memory for caching/storing frequently accessed data • Use Memcached.
If you will require large session data storage and also need query capability for a normal DB table, you can create a hybrid implementation wherein the other session values are being saved in DB but the session data is being saved in Memcached.” -
Hard disk speed will eventually become a bottleneck • The
solution is to move all cache/temporary files from hard disk to memory. Install mod_mem_cache for Lighttpd so that those frequently accessed static files will be kept and served from memory. This will result to lesser reads for the hard disks” -
Upgrade your Server Memory • “Memory is not that cheap
but it will be the cheapest upgrade that can give your server that added boost in performance that it will need.” -
Take note of your memory limit to minimize swapping to
hard disk • I also implemented the flushing of memcached on a daily basis through cron.”