370 points · by markbao · 15y ago · 188 comments
So I built http://threewords.me - literally an MVP that I posted on Facebook and my friends started using. Fast forward 3 days. The entire Twitter results page for "threewords.me" is of tweets that happened less than five minutes ago. The site grew 2x in pageviews over the past hour.
Two problems: 1) what do I do now? 2) how do I afford this?
Advertising? Hosting partner? ...daresay... investment?
Sorry to be brief. If you're curious, the stack is Rails + Ruby Enterprise Edition + Passenger + nginx, which isn't cheap like PHP to host. On the $40 Linode right now but maxing out CPU at 350%.
227K pageviews today. 50K uniques. 71% traffic referred. 8,285 users. 3,100 new users in the past 1 hour.
What happens now?
EDIT: Hello! This thread is not going unnoticed while I take my metaphorical fire extinguisher to the fires that are happening. Will reply soon.
EDIT: cranked the Linode up to 4096. $160 server, woo!
EDIT: David from Duostack (http://duostack.com) is helping with the load on his cloud Ruby platform. Many many thanks to him.
I was able to sign up and see just enough to get a feel before the site became unresponsive. I like that it's dead simple. I can also see how it's incredibly viral as it asks you to ask others to describe you -- very smart. At first glance it looks to me like something that could enjoy tons of traffic, but which would probably be short-lived. The challenge would be finding a way to have that traffic stick around...
I view this as a bit of a long shot, but I would do a few things. First, you've got to have the site handle the traffic. No advice on how, but find a way to get that done. Next, I would try to become known as the place to get a quick summary on anybody -- even celebrities. I imagine people will receive multiple adjectives from different people, but I'd have the site tally the three most popular and promote those as best describing of the user. :) I see a couple of possible pages for "viewer stickiness". The homepage could feature very popular users. Imagine showing the three most submitted words to describe /paulg or /marrington and other users with large responses... Next, on each user's page it could show their "friends" and the words that describe them. The site also provides the most recently submitted three words on the user's page. This might at least make each user curious about checking back at their own profile to see how people were labeling them. As for monetizing, that's probably with ads, as usual, but you have to be careful about when and where to put them. Like I said, probably a long shot, but who knows? Good luck!
How about analytics? For each person who writes about me, I could pay to see where in the world they lived, how long it took them to type in the three words (or even watch a movie of them typing them in), whether they clicked the link that was on my Facebook or the one on my Twitter feed (based on HTTP referrer), etc.
If you were confident you could give each user the ability to see this information for 1 user for free, and then have them pay if they wanted to see it for the rest of the users.
You mean like About.me is attempting to do? This is an interesting twist though...
However - the quick summary I look for on anyone of interest (professionally) is linkedin.
I do not and shall not have a facebook account.
A gossipy feel might be better anyway. Imagine the "word status" on Paris Hilton going from "hot" to "classy", "generous" and "caring" or something like that... ;)
Sites like this typically see eCPM between $0.10 and $0.30 for advertising. So you're looking at around $30/day revenue right now.
Consider switching to EC2. This will allow you to easily scale up to a more powerful server if growth continues or down to a less powerful one if traffic tapers off.
Depending on how you set things up, a common bottleneck for Facebook applications is API calls. Ensure you are not making any API calls from Rails, since this will cause Rails processes to hang until Facebook returns results. With high traffic this could easily cause your server to become overwhelmed. Move all API calls to Delayed Job or another background processing system if you haven't already.
It looks like you have relatively few remotely loaded assets, which is great. You can likely speed things up more by making sure that your database is well optimized for the server (Make sure query cache is enabled, and you have indexes on the right columns for example), and identify any actions that take a long time to return.
As for what to expect in the future, growth will not be infinite. There are a finite number of people on earth that are going to love your site and Facebook integration is a fantastic way to reach nearly all of those people in a very short amount of time. After a while most of those people will get bored and you will see traffic begin to fall. The best ways to address this are by consistently releasing new features to reengage users or by referring your users to other similar sites that you build.
In general the biggest trait is that the app is built around sharing. Apps where sharing is a secondary feature generally do much worse in comparison to those where the whole point of the app is to share something. Even successful games on the Facebook platform universally require users to share content with friends to progress.
Many of the most basic viral apps are simply based around sending gifts to friends. If 10% of users that receive some sort of virtual gift then go on to send it to an average of 11 friends, your app will be highly viral in no time.
The quick solution is to scale up your current linode package, however, I think you might find that your traffic is going to peak and will wane next week after everyone has gone back to school/work and is out of the holiday mindset at which point you can scale back.
Put in a throttle - /proc/loadavg
Limit it to X signups per hour, asking them to check back next hour. Collect email and notify when they can sign up. Point them at a facebook page, ask them to like the page, do announcements when the next 'batch' of users is able to sign up.
If you want some help analyzing the slow query logs and/or the normal logs, email me a url of a .gz/.bz2 of a reasonable snippet at hnusername@hnusername.com.
Since you're running nginx, consider doing an alias and use proxy caching. I would doubt your static files are causing too many issues, but, if you can cache computationally expensive pages a little, that can help.
That said, if you're selecting more than 5% or so of the rows in a table, you're probably better off not using an index.
Another random tip. There is a world of difference between putting indexes on 2 fields, and putting a composite index on 2 fields. If you have restrictive conditions on 2 fields, MySQL has to work with the entire list of rows that match at least one of those conditions. (I don't know whether MySQL has the trick of joining indexes together before looking at rows, but even if it does it has to work with a list of rows matching the condition.) By contrast with a composite index MySQL can only look at rows that match both conditions. Much more efficient.
http://www.slideshare.net/techdude/how-to-kill-mysql-perform...
http://forge.mysql.com/wiki/Top10SQLPerformanceTips
Good sets of additional tips/things to keep an eye out for.
Think about moving the code over to Heroku now, and keep scaling to meet demand.
If you don't have the cash, email me and I'll front you what you need to keep it up until you figure out how you want to roll with this. This is not a time to trip over pennies.
Congratulations.
A more traditional approach of 1 web and 1 db server (possibly even physical boxes) might end up providing better value and give him enough time to figure out how to scale this horizontally on EC2 (the web part should be easy...remove any in memory state data, the db might be a bit more work).
Even a small machine can trivially handle 150k pageviews per hour, even with ruby strapped around its neck.
Spiky traffic is an issue of its own, but it sounds like Mark's site is growing fairly steadily (albeit steeply).
I agree with latch that heroku becomes (ridiculously) overpriced the further you depart from the free plan. If a stopgap is urgently needed then it may of course still be a valid choice. But in the midterm, if you're pushing serious traffic, look elsewhere.
Hi there, your home page is very simple, render it in plain HTML and post the signup to queue.php.
In queue.php put:
<?php $data = serialize($_POST); mysql_connect('localhost','dbuser','dbpass'); mysql_select_db('dbname'); mysql_query('INSERT INTO cache(cache_data) VALUES(\''.mysql_real_escape_string($data).'\')'); echo 'YOUR REAL PAGE SHOULD BE HERE WITH A MESSAGE ABOUT BEING IN THE QUEUE'; ?>
The cache table should just be a PK cache_id and a text field (or perhaps mediumtext). I've suggested using a database instead of a filesystem based cache because, if you're doing this quickly, doing it using MySQL means you're less likely to run into file permissions or security problems.
Then you're at least capturing everyone's information whilst you figure out how to scale.
If I were in your shoes, these three items would be next on my emergency-scaling checklist:
1. Database sanity check: Are you using indexes for calls like "Find user by username"? Does your database need its own dedicated box?
2. Pick up another box for memcached. Full-page cache everything you can with rack-cache. Don't worry about expiration, just use some reasonably low TTL to put a throttle on your read requests for now.
3. Move all of your static assets to S3 + CloudFront. Gzipped, with a far-future Expires header. While you're in there, move the JS to the footer of your layouts. No sense serving any of that stuff from your Linode boxes if they're as pegged as they sound from your other comments.
As to making money? No clue. Maybe I'll have an idea when I can get a request through and see what the app is all about ;)
One thought occurs: this seems to be a very vanity-driven kind of app. Find a way to charge $1, $2 or even $5 for some simple premium vanity-stoking feature and you could be in good shape. Better than advertising, in my book.
Have fun!
2) Throw up an ad or two, with the goal of having the ad revenue pay your server costs. This will allow you to not worry about the financial situation while you're fighting fires, so you can defer thinking about investment etc until later.
(now after you have the servers tamed...)
3) Make sure you are incorporated. You probably want to be an S corp or LLC.
4) Look at your metrics and decide whether you have a sustainable property or not. (Look at your retention numbers) Based on the data, decide whether you have
(a) a self-sustaining cash cow, (b) something that can be huge and take over the world, or (c) a fad that will grow and die quickly.
If (b), and you need money to get there, start talking to investors. But don't take money too hastily- it's a long term commitment and you'd better know what you're getting yourself into.
If (c), try to sell it to someone who thinks it's a (b) before it dies.
Congrats and good luck!
1. You have significant profits or net income. 2. You have high liability. 3. You're getting funding.
I doubt this meets any of those criteria, unless someone offered to fund him.
Here are the relevant links if you want to see what I'm talking about: HN Story - http://news.ycombinator.com/item?id=2047818 Podcast - http://cameronkeng.com/podcast-ep-1-incorporation/ Summary/Notes - http://pastebin.ca/2033868
For example, how much would I save by incorporating if I make 1k versus 10k versus 100k a year?
I see a lot of parallels to formspring, whose pagivews/month graph looks like this: http://www.quantcast.com/formspring.me
So you either want to sell as it nears the that peak, or you have to be ready to stick out the trough of sorrow and invest a lot of time into finding a way to grow and monetize it.
So if you have some great vision for how you can turn this into something awesome, super-popular, and monetizable and you want to invest the time in it, you should go for it.
But if not, you're probably going to get some very good offers over the next few days--especially compared to how little time you've invested. If I were you and wasn't totally in love with the site, I'd get out while the offers are good and invest that money into your other businesses. Then when your next site goes viral, you'll just have to wonder how to get it back up ASAP, not how to afford doing so :)
But according to Crunchbase, formspring raised a $10MM series B just over a month ago (well after the decline was obvious). I wouldn't be surprised if some of that went directly into the founders' pockets.
You're 17/18?
Kids these days. Geeze.
Fine work sir, though I don't have much advice to offer beyond what has already been stated.
This way - you could target ads to FB accounts/users that are all "snowboarders"
Or you can at least search who among your friends have the tag [snowboarder].
Or if you give more categories to the tags, you can ask your friends to fill in their favorite 3 [X] -- so you can simply ask all your friends a question and then build an interesting DB of tags/info/interests of all FB users.
http://www.facebook.com/pages/Snowboarding/107496599279538 1,784,641 people like this 9 Friends Like This
1. Upgrade your linode to something around 2 Gig for now.
2. Start playing with your MySQL or Postgresql config (assuming you're not already using redis or something similar, in which case just throw more RAM at the box). Google performance settings for your DB of choice and look for relevant posts to the memory you have.
3. If there's anything cachable, install memcached and implement it.
4. Purchase a second linode and move your database to it.
5. Upgrade each VPS as needed.
6. At this point you get into fancy scaling and there are loads of options. You should have plenty of breathing room by this point though and can plan it out.
Edit: Google Cache got it: http://webcache.googleusercontent.com/search?sclient=psy&...
EDIT: Cranked to 4096
I don't know if you read the "Sacked by a Google Algorithm" article from yesterday. http://www.duckworksmagazine.com/11/columns/guest/winter/ind... The comment you make on the results page sounds dangerously close to what got Adsense to boot him.
A few people have posted my URL to social news sites like Reddit and Digg, but even when those gain traction it's usually just a few thousand and quite short-lived.
1. Monitor your retention. Are people coming back or just checking your site out once? You can go viral very quickly but tank just as quickly once the initial interest dies down.
2. Start thinking about a business model. Highly viral sites that don't retain well could really hurt your bank account if you're not monetizing. If you can't can come up with an interesting one, throw up some ads to tide you over.
3. As soon as possible, get your database on dedicated hardware. Your bottleneck is going to be the database: so memcache, add the right db indexes (get a backup db so you can hot-swap while you do this), and add lots of RAM if needed. You don't want to be scrambling to migrate your database once you hit the limit.
Also, for the short term, Amazon EC2 would be the best option to handle the traffic.
I suggest migrating it to Heroku. Push your code, copy over the database, and crank your dynos up. They charge by the hour, so as an example if you have ~10 dynos running (roughly equivalent to 10 thin instances, but slightly better) for 5 days (or however long it takes for the initial traffic surge to subside), you're only going to pay about $50. Then, you can turn down your dyno count and pay a reasonable monthly fee.
Anyway Mark, I have a bunch of apps on Heroku that use all kinds of wacky stuff—including the aforementioned gems—so email me at jarin (at) robotmodehq.com if you decide to try out Heroku and get stuck. I can send over working code snippets that you should be able to just drop in.
You'll need to redirect to a facebook page to use credits because they aren't available off facebook.com yet. They don't have many good examples of offsite apps using credits, so they could streamline the approval process I bet. Email me with questions.
Certainly this hasn't been proven with apps off of facebook. It's an excellent experiment though.
If you really want to grow even faster:
1) scrap the standalone website and build it as an iframe app (should be very little work). This will simplify login significantly and will keep people inside FB, which in my experience, makes a world of difference in the viral funnel.
2) replace the "share this link" with a real Stream.publish call. Consider adding like buttons for every single user's page.
3) Allow people to see which of their friends have answers as well.
Then, if you add the 1 credit transaction, you should do pretty well. Beware, however... Facebook has given out a lot of free credits to users and they do not give app devs any payback when free credits are used. These chargebacks can affect actual revenue from small transactions like this significantly.
Did you actually felt the need to have such a website? Or you just figured people will like it? How did you figure that out?
Please, share.
I think I understand it now. People use this, because they wanna hear people saying good things about them. I think most people would send link to their friends, because they don't feel very confident about themselves.
It's the basic principle of Facebook (or of whatever Facebook turned into) - people post things so they would get positive feedback and they would feel better about themselves.
Maybe in put down your follow ideas in short little phrases and have people provide three words on that, if they wish, along with three words on their friends. It will give you great insight into what THIS audience thinks is a good or bad next step for you.
This is a site that will not maintain interest as it is beyond a short period unless you add more to it. So the key here is to move forward quickly, even if it is in tiny incremental steps. letting the users help you make some of those choices of what steps to take can only help.
It would have perhaps been better to setup a wildcard DNS/vhost and set it as http://joe.threewords.me. It can still be done but the earlier the better. Time is of essence here.
Regards
Joe
So in your DNS zone you can tell it to route all accounts that start with the letter 'a' to server with IP 1.1.1.1, letter b to IP 2.2.2.2, etc. Server with IP 1.1.1.1 will not only run a headless web app but also route SQL queries to a db shard (all relational data for users starting with the letter a).
This level of "user" partitioning can be deeper. So it's not just the first letter of the user but two or three more letters/numbers. So joe.threewords.me would be on a different server than j4mes.threewords.me (That's j.o.threewords.me vs j.4.threewords.me).
Regards
Joe
Go to static content wherever you can and get it replicated out and hosted somewhere.
consider something like HAProxy (well.. haproxy!) in the stack out front to control concurrency to resources that are bottlenecked - that way you can at least get linear degradation instead of out of control degradation.
EDIT: Drop the dynamic content wherever you can, shut off whatever dynamic parts you can and then scale out horizontally. Then fix the bottlenecks and bring them back online.
Interesting. Makes me think that an MVP should be done in PHP or something else that is cheap to host and handles these sorts of conditions well, and then if things look bright build the real site in whatever seems appropriate for the expected demand.
I think he just should have hosted on Heroku as he could have scaled it a bit faster.
are those 'sign in with Facebook' buttons trust-worthy?
I've only clicked one of them, and that was a 'sign-up' button for an event i will be physically attending
everytime i see one, I worry that
a) it's going to broadcast to my entire friendlist that i signed up for this service
b) it's not a REAL facebook button, but something to phish my account
c) this site will know my Facebook login
d) some other party will intercept the login...
tell me it's completely safe?
threewords for threewords.me: hot new cool
Regarding the BizModel. Forget it and grow as long as the hype works.
If you can't: Offer the possibility to add an optional reponse email. An ask for a penny if people want to contact the anonymous poster. Cooperate with FB for FB Credits to see this work.
Expansion: Threewords for all type of content (blog articles, third parties like celebrities, etc)
I need to up the copy on the site.
As a DB they say it's designed for SPEED and SCALE. It might be worth looking at. (who's got the time right?) :)
1. Implement caching. 2. Get faster servers to handle your 'debutant' phase' ex: EC2 3. bask in limelight, enjoy!
Without knowing more about your setup I'd offload assets to S3 and switch from Passenger to Unicorn.
Good tip on Unicorn. Any benchmarks on the performance gain over Passenger+REE?
But something you could do immediately to help with the load is to run haproxy on your current linode and funnel some of the traffic to a new linode that you spin up.
How did it go? Is the traffic still sustaining? Also tell us if you have been able to monetize it? Share your experiences with a blog post.
long term: app engine (just port it to webapp framework)
App engine after that b/c it should be fairly easy to port and it's an extremely headache-free way to host an app. Now that they have always on instances, it's very fast and scales efficiently and effortlessly.
I will pray for you.
thats how i survived a mini fb app thatwent from zero to 44 million users in 7 days... rackspace cloud + memcache + redis insert&update queue + round robin. after a month i even killed the rackspace cloud interface and api with over 80 nodes and growing. had to get the memory limit on my account raised twice. peak were around 40k req/sec. after the second month we moved it to four bulky servers (16 core, raid5, 32gb ram) each cost around 12k dollar.
the whole secret is caching. everything, everywhere and as much as possible.
Then monetize it, baby.
10 million, or something like that.
From ONE customer. who could well drop them.
So, they're breaking even (for now).
And all this while they have raised 360 million in VC money (crunchbase).
And nobody has a clue how they will make REAL money.
Or do you?
Sadly to say, it's received a total of 300 visits. :-P