0

I'm having an issue where my theme creates a pile of images sizes on uploads (because it's supposed to), and my server periodically gags on the process. It's resulting in a pile of "MySQL server has gone away for..." problems, and I end up with media uploads that contain no data.

A dedicated server isn't in the budget. And my web host isn't a big fan of making more RAM available to my account. So moving from my current hosting solution isn't an option.

However, I've got a test server sitting here in my office with 4 CPUs and 16GB of RAM, and I thought, "Hey, is there a way I can host all the WP-admin functions locally, and simply push changes to the remote server?"

A thousand apologies if this has been asked elsewhere. Everything I could find on the subject was just about setting up a local testing server. My case is different - I want the back end hosted somewhere other than the front end (and yes, the final DB should obviously also be remote, unless I can find a way to simply push DB changes to the live server).

1
  • Doing this locally should not be considered an option unless you have the infrastructure for it, nor should syncing local or staging/live without good knowledge of how it works. Move hosts or go into the cloud, amazon and xeround supports remote mysql, and it's not exactly expensive.
    – Wyck
    Commented Feb 23, 2013 at 18:44

3 Answers 3

2

"MySQL server has gone away for..."

This should never happen as result of admin operation on vanilla wordpress. One post publishing should not include enough DB writes to make the DB go away. Have you tried with all plugins inactive?

Hey, is there a way I can host all the WP-admin functions locally, and simply push changes to the remote server?

Theoretically yes, you can use rsync or any other file sync software to sync your files (just the uploads directory or maybe even the full WP install) and some DB sync tool (I'm not an expert so will not try to recommend) to sync the DB

Two things to remember to do if you will try it

  1. Configure your hosts file to have your sites domain to point to your PC
  2. Depending on the DB sync tool you either will have to ask your host to let you access the DB server remotely an idea which your host might not like.

IMO the effort you will waste on investigating and implementing such a solution will better go into finding a better host.

1

WordPress is not built to do this, but I think it is probably possible in some sense. I think you would need to run your remote site like a mirror and sync your files and database from the local to the remote site, but you will have trouble keeping URLs straight. Both sites would be full WordPress installs, you just wouldn't use one of them for management. That said, this would probably take more server access than you have on your remote server (based on your description).

I don't think this is worth the effort and the wretched agonizing pain. My suggestions would be, not necessarily in order:

  1. Put the server you own have in a datacenter and use that. You can make a dev server from just about any $500 PC.
  2. Get a static IP for your office and run the site from there. You would of course need a solid internet connection.
  3. Get a better host. WordPress runs fairly well on pretty cheap hosting so I have to conclude that your hosting is on the bad end of "crappy".
  4. You could probably set up some kind of caching proxy on your remote site, but again, that would take more server access than you have.
0

I guess answering this question won't help you any further with your initial problem.

Technically it's possible to build such a construct (with rsync & mysql replication) but it will require infrastructure & a lot of work and won't add any performance to your situation. As you are on shared hosting you will most probably not have the chance to connect to your MySQL db remotely as this is disabled in almost any shared hosting environment. You can build an http-wrapper around this issue, but the performance is normally pretty bad compared to local db interactions.

If you are sure that your issues are not related to your wordpress install (bad plugins etc.) and also happen on a vanilla install I'm pretty sure you are better of with searching another hosting provider (I would go the route and buy a small VPS)

So sorry, for not answering your question but I just feel like this would be a totally complex project without any beneficial effects for the actual problem. If your hosting plan doesn't even allow you to resize a few images what should happen if you really have some load on your page?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.