5 ms·
Ask HN: Our site just got onto Mashable - HELP
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)
- jimboyoungblood 16y agoHow much traffic was Mashable throwing at you?
- wesleyzhao 16y agoWe 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.
- thomasdavis 16y agoWhat technologies are you using?
- dshipper 16y agoWe are using PHP, Javascript and MySQL
- dmc 16y agoWithout 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/ http://memcached.org/ [2] http://news.ycombinator.com/item?id=2220273 http://news.ycombinator.com/item?id=2220273
- dshipper 16y agoDo 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 :)
- dmc 16y agoI'm not familiar with that service, sorry. However, looking at their FAQ from [1]: "Totally customizable, each Cloud Server gives you full root access" so I would imagine you can make any changes you'd like. However, every host is different and YMMV. [1] http://www.rackspace.com/cloud/cloud_hosting_products/servers/faq/ http://www.rackspace.com/cloud/cloud_hosting_products/server...
- sfrench 16y agoLooks like you probably can. http://www.rackspace.com/cloud/blog/2009/07/30/setting-up-memcached-on-cloud-servers/ http://www.rackspace.com/cloud/blog/2009/07/30/setting-up-me...
- sagacity 16y agoCongrats! You might want to check this (and possibly also the parent thread), quick: http://news.ycombinator.com/item?id=2235994 http://news.ycombinator.com/item?id=2235994 God speed. :-)
- sagacity 16y agoAlso, 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 http://news.ycombinator.com/item?id=2255089 Edit: Or, directly: http://IPLoc.info/api 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.
- dshipper 16y agoThanks 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.
- rst 16y agoAt 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 http://www.learn-mysql-tutorial.com/OptimizeQueries.cfm
- dclaysmith 16y agoI 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.
- wesleyzhao 16y agoWe 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?
- sfrench 16y ago| What is a slow query log? It's basically a log kept of queries that are running slower than a set threshold. Read through this for the details to set it up and access it: http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
- fhars 16y agoIf you are writing frequent updates to your MyISAM tables, you should switch to a database backend that allows concurrent updates. MyISAM is only useful for read-mostly or single writer scenarios. See also http://www.mysqlperformanceblog.com/2006/06/17/using-myisam-in-production/ http://www.mysqlperformanceblog.com/2006/06/17/using-myisam-...
- wesleyzhao 16y agoThanks! I think we have switched over to InnoDB, you think that may be sufficient?
- hallmark 16y agoHey 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.
- dshipper 16y agoThanks so much for all of your help so far!