Move application to cloud? Don't know how to overthink this
June 29, 2021 9:13 PM   Subscribe

Hi. A decade+ ago I did sysadmin work, but now do largely non-technical consulting. However, I have a big job coming up in a couple of months that will hammer my shared server into oblivion and I need some insight into how I might/might not do this on cloud servers. Technical specifics below re: linux php mysql and traffic burst loads.

Current setup: shared hosting on dreamhost running a php program (LimeSurvey) storing things in a mysql database. Between that and my wordpress I get acceptable but sometimes sluggish performance on a very low traffic site.

Challenge: I have a contract that will hit my limesurvey server with about 16,000 different users in the course of a business day, not evenly distributed during that time. I did a quick test loading the first page using load.io and it started timing out the requests after about 150, or about ten seconds of solid traffic. Querying the shared mysql server it showed all traffic as Threads: 13 Questions: 1549625514 Slow queries: 31885513 Opens: 92728877 Flush tables: 1 Open tables: 2048 Queries per second avg: 562.688

Wishlist: I used to work for qualtrics and dream of the day when I had access to unlimited computing, but my business is too small for me to make an investment in that platform (survey work is not my main income stream)

Naive Thought: Not being sure if this is a shared host issue with apache or, more likely, opening up connections to the db and getting throttled, is this a good opportunity for me to start with a cloud solution? Starting thought:

DreamCloud would let me move to a 2 vcpu 4gb ram server for a pretty low cost, and I have built out a lamp server there. So far so good. Here are the challenges:

1. Sure it seems quick, but am I living in a Fool's Paradise?
2. Would I be better off running two cloud servers, one for http/php sending db traffic to a server for mysql? How would I test this since the free load.io seems a pretty coarse measure.
3. Am I thinking about this correctly at all? Should I build a Beowulf cluster out of Slackware in my basement -- that is about when I left off thinking about these things from a technical standpoint.

Thanks much for the hive's thoughts on this.
posted by cgk to Technology (5 answers total) 1 user marked this as a favorite
 
If it's just running for a day, you can rent a very powerful server for just that day (+ a few days for setup), which should be able to easily handle that load (assuming the server software is written in a reasonable way).

Renting a powerful cloud server (on AWS or GCP or DigitalOcean or wherever) and setting up a LAMP stack on it will get you pretty far.
posted by wesleyac at 9:40 PM on June 29, 2021 [2 favorites]


it started timing out the requests after about 150

Check your max_connections value, the default is at 150 - you might very well be hitting that.

Also it seems like you have lots of slow queries, it is worth using the slow query log to identify them and see if things can be improved with better indexing (assuming you are not going to mess with your code base for a one-time thing). A poorly executed query might not be impacting performance noticeably when the load is low, but be enough of a bottleneck under high load that throwing hardware at the problem won't help much.
posted by each day we work at 10:13 PM on June 29, 2021 [7 favorites]


Best answer: I’m with each day we work. It sounds like you’ve never had to tune your current server for anything other than a trivial workload. You could rebuild what you have on a huge cloud server & still hit exactly the same issue, if your constraints are in your config as opposed to your hardware.

There’s zero point in scaling your hardware until you’ve tuned to the extent that you can increase load & hit a hardware bottleneck.
posted by rd45 at 11:13 PM on June 29, 2021 [5 favorites]


Response by poster: Hi everyone, thanks for the responses. It has certainly given me some direction for areas to think about. For clarification:

1. The current server that generated the stats is the shared server, so I have no control over any of the internal configuration for the db and connections. I don't think I have access to the query logs or to much in the backend, but it is good to know where you think the bottleneck is.

2. That and @wesleyac's response make me think that running a private host on Linode or DreamCloud would not only elminate all of the shared overhead (those stats were from when my site was idle, so it is the background load from other users). I have tinkered around and have my setup running with 2 vcpu and 8gb ram so it looks like the proof of concept works out for me.

3. Since I have root access, I will be able to work on better settings as @eachday and @rd445 suggest.

As always, I appreciate having experts take the time to weigh in on AskMe, it keeps me learning and moving forward.
posted by cgk at 1:38 PM on June 30, 2021


Best answer: One option, depending on exactly your requirements/traffic, you could look into using a hosted LimeSurvey option. We used LimeSurvey GmbH for a moderate sized survey (a few thousand participants, answering dozens of questions, at 2-5 different times) and was fairly happy both with its availability and API access. Not perfect, but fine. (Here are some more options.)

But if that's not an option, I would probably do two small-ish hosts at Linode or similar if you don't have cloud provider experience, otherwise AWS or GCE with a moderate-sized app server and one of their managed DB products (RDS for AWS and Cloud SQL in GCE).
posted by skynxnex at 2:43 PM on June 30, 2021 [1 favorite]


« Older Podcast recommendation?   |   Soliciting advice from fem,NB who've been... Newer »
This thread is closed to new comments.