Ask HN: Our site just got onto Mashable - HELP

14 points by wesleyzhao ↗ HN
Hey Everyone, For the past few weeks my friends and I have been hacking together small projects from our dorm rooms trying to find something that would stick.

Two days ago we released WhereMyFriends.Be, and last night we were fortunate enough to have been posted on Mashable! We immediately were forced to migrate to Rackspace to make sure our site stayed up: http://wheremyfriends.be

We have been up all night maintaining the site, catching any bugs from users, and just making sure things go smoothly.<p>We have noticed the site slowing down over the course of the night and have been on phone with Rackspace. They think the problem may be a piling queue of requests to our MySQL data tables (which are currently using MyISAM).

We really want to get the site back up to speed as soon as possible but we are honestly at a loss for what to do. We've never experienced a traffic surge like this before. We are on the verge of putting up a landing page and stopping the flow of Mashable traffic.

Does anyone have any suggestions for what we can do to get ourselves back up and running?

Thanks for any suggestions!

(Note: we are using PHP, MySQL, Javascript)

19 comments

[ 4.3 ms ] story [ 54.3 ms ] thread
What technologies are you using?
We are using PHP, Javascript and MySQL
Without being familiar with your service, do you implement caching? memcached[1] may lighten your load if you do not.

What web server do you use, apache? Perhaps nginx or lighttpd would be a better fit if you do use apache.

Check out this post[2] for more details on decreasing load.

and try not to knock your server offline at your peak time ;)

HTH.

[1] http://memcached.org/

[2] http://news.ycombinator.com/item?id=2220273

Do you know if we would be able to implement on Rackspace's Managed Cloud hosting? Considering we haven't slept in forever it seems like it would be hard for us to learn how to set up a new server manually at this point :)
Also, as discussed in one of your previous threads, in case the current Geolocation API you're using is slowing things down (at least in part), you might want to try this:

http://news.ycombinator.com/item?id=2255089

Edit: Or, directly: http://IPLoc.info/api

(Partly inspired by your thread from which, I sent you an email, but never heard back from you.)

If you wish to try this, I'll be happy to work with you to get our (free) geolocation API setup on your site quickly.

Thanks so much I really appreciate your help, and sorry for my delayed response to your email. Hopefully we can get your API running with our setup.
At the risk of stating the obvious, you might want to check the query plans on your most common mySql queries, to make sure that all the appropriate indexes are in place and in use. I've not done this with mySql myself, but this looks like it might be useful:

http://www.learn-mysql-tutorial.com/OptimizeQueries.cfm

How much traffic was Mashable throwing at you?
We got about 20,000 hits just form last night! It was huge and very exciting for all of us. You can't imagine all the girl-like screaming going on in our dorms and our freaked our roommates.
I would:

* Change the landing page you have up there. Focus on the product (not your current predicament). A few screeshots. Make people want to comeback later today or tomorrow.

* Eliminate any non-essential database calls. Convert php files to static html (or copy and paste the output of the page and just echo it).

* Check your slow query logs in mysql and index. Definitely make sure you have any primary keys set and foreign keys (used in joins) indexed. Then look at your queries and add index on your slowest queries.

If you aren't sure it's MySql, copy all of your images onto Rackspace cloud files/amazon s3. This will lower traffic through your machine/disk access.

We wanted to really focus on our story since we are hoping people will continue to use the apps we create and they will know us for being people the love. Rather than just focusing on the product.

We have combed through the code and believe we have eliminatd non-essential database calls but will look again. Also I guess we could always use static html for header/footer rather than including/requireing it.

*What is a slow query log?

Hey guys, first off, congrats!

You'll get many snippets of advice here, and tons of web resources to chase down and read.

If you want to revert back to a live site quickly, may I recommend direct help? I'll step in first and offer my services. Or ask here and I'm sure other HNers will step up as well.

I've troubleshooted MySQL slow queries. I've done memcaching and static file hosting on CDNs.

If it takes a ton of effort, we can figure out compensation once the site is back up and running like a charm. If you don't have any money, list my name somewhere and help me build my personal reputation. :)

HTH. I've also sent an email to Dan.

Thanks so much for all of your help so far!