-
Website
http://blog.awarelabs.com -
Original page
http://blog.awarelabs.com/?p=28 -
Subscribe
All Comments -
Community
-
Top Commenters
-
williyamb
1 comment · 1 points
-
Malcolm Tredinnick
2 comments · 1 points
-
Seo Company
1 comment · 1 points
-
boston movers
1 comment · 1 points
-
rasiel
1 comment · 1 points
-
-
Popular Threads
To be fair, those guys have way too many sites crammed into one shared host. Jeff Croft's site is on the same server as well as a few other popular ones. I think the box we were on was destined to swell beyond capacity sooner or later.
Good and bad news is Arkayne swelled sooner. Sorry for crowding the CPU, should all be fine now since I relocated. Unless one of the other sites does the same, which appearantly as everyone tells me is a nice problem to have. I always thought too much money was a nice problem, not increasing costs.
We've hosted http://ShowMeDo.com there for a year (and we eat cpu/memory with increasingly regularity now) - Remi, David and co have been incredibly responsive and helpful.
I've only had memory-warnings when indeed I've gone over-quota, they're helpful and have offered advice. Switching to memcached was a big win for us, as was optimising SQLObject queries.
I'm a little shocked by your comments about the team up there - that's the first bad news I've heard about them...I'd suggest other readers do some research (maybe I've just missed other bad write-ups?) but all I've heard are good things. My own experiences have been great - supportive, responsive and understanding.
Ian.
As far as efficiency. I was running a few expensive batch jobs every so often but without those it was a simple query. Fetch a set of indexed records and return them. Nothing too complex, query itself took very little time. My processes hovered arounf 18MB a piece but my CPU tended to spike to around 50%-90% on a hit.
Every site is different I guess. As far as being lucky or unlucky, Web Faction offered to move me to another machine because that one was heavily loaded. I didn't take them up on it because I was worried I'd have the same problem all too soon. From looking around the processes I could tell lots of other popular sites were on there too. And we definately had more than 2 sites on the server.
On the dedicated machine performance is significantly better without any code or query optimization. All things aside, given time and money its the best optimization I could have done at the time.
Tell me more about Django caching, I may be doing it but know it by a different name. What is it and how do I activate it? What are the benefits?
It is also worth mentioning, in order to make serverpronto cost effective, you need to know how to sysadmin your site. They won't help you...unless you want to pay them, which blows the whole cheap thing out of the water.I recommend running in vmware server in order to be able to easily move from one serverpronto machine to another..upgrading as necessary. Purchase a second ip address - a 1 time fee of $10 and use bridged networking. Setup iptables on both host and vm....i tossed all that web based admin bullshit it comes with. weak sauce.
Also, I'd be curious to know how far the 256MB of memory get you. Once you run the operating system, the web server and database server that doesn't leave much left for your actual application and memcache.
With most shared hosting providers, the memory that they give you is for your actual application and you don't have to worry about the memory used by the OS, the web server and database server.
The invaluable James Bennett had a good article on performance tips that included a section on caching (http://www.b-list.org/weblog/2007/nov/27/perfor...). Basically though Django gives you a bunch of options ranging from whole-site caching (eg: any page w/o POST or GET parameters is cached the first time it is generated and reused until the (configurable) time limit is reached.)
Say for example the front page of your website is pulling dynamic data from the DB - the last ten somethings, a menu structure, a content block, etc. The process for generating all that involves a dozen queries, view code that builds data structures and templates that render the data. The result is just a text file though - and if you cache it for 10 seconds and get 100 hits in those 10 seconds only the first hit goes through the whole process of querying the db, rendering data, etc, and the other 99 simply feed the saved file. You can see that this would have a dramatic effect on performance.
If you just have too much dynamic data for a whole site cache you can also cache individual views (as simple as adding a decorator to the view function) or even use caching template tags to cache fragments in a template. There's also access to the Cache API in python code so you can cache objects (like query results, etc). As usual the docs are pretty good...
As far as running VMWare on Server Pronto, I'm not sure I have the need. VMWare is absolutely awesome by the way. My experience with deploying a django application on Fedora has been great. I used "yum" to install django, mysql, and a fe python libraries. Beyond that setting up Apache and copying my Django application was cake. All in all the setup took a few hours, and I could probably repeat it in 30 minutes this time around. Setting up extra IP addresses and configuring VMWare on the server sounds like a comprable task.
If I ever plan to deploy to multiple servers then VMware may be the right solution.