Old 05-06-2007, 04:35   #1 (permalink)
lwallenstein
Web Designer
 
lwallenstein's Avatar
 
Join Date: Sep 2006
Location: Ellicott City, MD
Posts: 24
Send a message via Skype™ to lwallenstein
Optimizing My Web App

I am currently working on developing a web app (iStalkr: Social Feed Aggregator) .. it created a lifestream from all your RSS/ATOM feeds. The app is written in Ruby on Rails and I have been experience a couple problems with scaling (the database with the limited amount of users still has over 300,000 updates in the first month.

I am looking to know if anyone has any reference or resource to information about optimizing mysql 5.x for a machine running a sort of LAMP configuration (2GB of RAM/Dual Proc/Dual Core) with the machine running the web server, mongrel and mysql.

Any reference/tips/pointers would be great.. the couple I have found don't seem to work with my configuration and mysql is sort of a black box for me.
  Reply With Quote
Old 08-06-2007, 00:06   #2 (permalink)
proc355
Senior Member
 
proc355's Avatar
 
Join Date: Sep 2006
Location: Glasvegas
Posts: 872
300000 updates / month is ~0.1 per second - I doubt the db config is to blame - you could run that on sqlite, and then some (unless you're having spurious heavy loads that push that figure way, way up); assuming relatively small datasets, you're aren't pushing 200Mb BLOBs eh? :P

I'm not sure what you mean by 'sort of LAMP' :P but I assume you mean you're proxying to mongrel from apache? how many in the pack? any particular reason you're using apache?

I no longer have much to do with mysql (postgres ) so, random tippage (it's 04:42, my pit is calling :P):

have a look at nginx - fast lightweight web server/proxy/balancer - apache is a fat hog that collapses under load

the more mongrels the merrier - minimum two, four is good; maybe 30-60Mb+ each. ana apache process will easily eat that much too... nginx you're talking about a couple of Mb, yep, really, and it's slicker than shit outova ducks arse

benchmark/profile your app - chances are something is choking it there - dont forget rails is single threaded; maybe you need to hand some of your work off to backgroundrb

check your queries - lots of SELECTs for UPDATEs ?

scaling a rails app generally means chucking more hardware at it - multiple application and database servers fronted by a load balancer - doesnt sound like you're anywhere near that yet

linkage:

nginx.net
blog.kovyrin.net/2006/05/18/nginx-as-reverse-proxy
errtheblog.com/post/3908
cfis.savagexi.com/articles/2006/06/21/ruby-prof-0-4-0-with-call-graphs

irc.freenode.net/#rubyonrails - if you're timing is good there is genius in that channel (not me lol)

hth - cant post proper URLs cos i'm a nooby lamer, sorry

btw, iStalker - spot on
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8