

Ask HN: How do I estimate app hosting costs? - mattmiller

I am bidding on an application and I don't really know how to estimate the hosting costs assuming the application receives a large number of users. I think a high estimation of users is about 100,000/mo, maybe up to 1,000,000 page views per month. This is an optimistic estimate, but I have to expect the worst/best case, I will not have to chance to ask for more money if the hosting costs are above my estimates. Advertising to supplement income is out of the question.<p>Does anyone care to share their experience with applications this size?<p>A little about the app: It is written in php and reads from a mysql server and does basic data formatting. There is no ORM or framework, so db interaction is as fast as php/mysql will allow. I predict that page views will be spread out over a large number of URIs, so lets assume no caching.<p>One more thing, the app is simple enough to port to app engine or Heroku, would this be a lot cheaper than Joyent (my current provider)?<p>Thanks for the input!
======
tlack
At this point in my career, I'm pretty confident in my abilities to get a lot
of work out of minimal hardware, but it took me a lot of hard lessons to get
there. Here's my random input for what it's worth.

So you're saying the structure of the proposal is such that you can't build in
a clause that scales the infrastructure costs as site traffic increases? That
puts you in a negative place in terms of your costs matching your income.
Consider trying to chip away at this limitation in the broader sense; it's not
a fair constraint on your side.

Also from the tone of your message I would assume you're fairly new to high
traffic sites and growing sites past millions of visits.

These two factors make me think you should shoot high and build in some wiggle
room for your 35k page views/day application.

Unfortunately, the amount of work a given PHP app needs to do to serve a page
view can vary greatly. If you're just serving images and counting the views,
you could easily get away with a cheap Linode box - their Linode 1024 would
probably work in this case. However if you're building complicated reports for
each user, based on an ever-changing database, you should consider a dedicated
server at Softlayer.com or similar in the $200/mo range.

One more note about pricing infrastructure in general: A nice thing to
consider which I've learned over the years is that going too big on the
infrastructure side is actually in some ways better for the client. The money
isn't going directly to you, first of all, so the client won't think you are
just lining your own pockets. Plus it shows an actual concern for your ability
to serve the customer - you would rather have too much capacity, have the site
be too big, rather than even risk it falling down and harming your clients
reputation as a result. For this reason, a lot of consultants will encourage
unnecessary load balancers and firewalls, just to be "buttoned up" and have an
extra level of safety.

~~~
mattmiller
Thanks for the numbers! I was afraid that a dedicated server would not be
enough hardware, it is reassuring that you think I could get away with a
Linode plan.

Based on your response and talks with some other people I think I am being
overly cautious. I guess it is better to error on that side though.

~~~
tlack
"One million" sounds like a lot, but "35 thousand" doesn't - the daily load
isn't as scary as it seems, unless you are doing a lot of heavy lifting or
it's verryyyyy bursty.

------
Toucan
I've run a 250,000 pageview/month vBulletin forum (MySQL and PHP, you can
judge for yourself how efficient you think this would be as a comparison) off
a server destined for the scrapheap:

1.8GHz Celeron, 512 MB RAM, 1 x 5400rpm IDE disk

For both httpd and mysql.

The server occasionally got a bit loaded during peak times (geographically
specific market), I'd say I was operating at roughly 80% of capacity, about
the edge of comfort.

This was just a hobby site on the side, you may want to consider the
additional costs of redundancy, off site data archiving, perhaps even
splitting infrastructure across two datacentres and hosting providers just in
case.

Ideally, you'd have access to the application in order to run your own
capacity testing, can you arrange that?

~~~
mattmiller
I am torn between a dedicated server or a VPS. I thought for a moment about
app engine or one of the other non-standard cloud based systems but I am a
little uncomfortable at the lack of control and costumer support.

To answer your question, yes I can run some capacity testing. Your experience
makes me feel comfortable about this; I don't mind upgrading to a more
powerful server, or probably running a couple of servers, when/if usage pics
up.

I was looking for some numbers to base my estimates on and this is perfect!
Thanks.

------
famfam
Even if you assume all the traffic comes in during just an 8 hour window of a
24 hour day, that's still barely over 1TPS. It's nothing. You didn't say how
big your dataset was in mysql. If you were at 100x data to RAM ratio I would
definitely be worried, or if you had any especially slow queries. I think even
if you were at 10x data to RAM ratio you would be okay mysql-wise, assuming
you're getting something close to 10ms latency on your disks. (Which you ought
to be able to with Linode/Slicehost/EC2). If your app for whatever reason has
burstiness (e.g. sharing/viral events) then you need to plan around whatever
peak load you're willing to support.

BTW, my personal opinion is that Joyent is grossly grossly overpriced. And are
they still forcing you to run Solaris?

