New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
VPS shut downs while importing large database
The vps has 1GB RAM with 1 vCore @ 3.5 GHz. I'm trying to import a 1GB mysql database through ssh. While it's in progress of importing the database the vps would just shut down after like 5mins and I would have to manually boot it up again. I checked if there were any error logs but none were created. I absolutely have no idea why the vps keeps shutting down when I try importing my large database. Anyone know what could be the problem?
Comments
Can we know how much bandwidth does your DC allocates you?
Did you check the CPU usage while importing? Is your CPU dedicated or shared? Which provider are you using?
It's Unmetered @ 100 Mbps and this is on a fresh ubuntu install
Some providers implement the auto-check and shutdown VPSes which cause too high CPU/Disk load. I guess it's this case.
You should open a support ticket with your provider to make sure.
You might check AUP about cpu usage. Importing mysql database usually hits 100% usage.
Is this an OVH discovery VPS by any chance?
no it's not
Are you sure you're not running out of memory etc?
Can't see this been bandwidth related. It's only 1GB..
It is not bandwidth related, i am pretty sure.
The only thing that comes to mind is that if your host/provider implements some of those auto anti-abuse systems on their nodes. If that is the case, if you are constantly using a lot of CPU then your vps is automatically shutdown.
Hence, try ionice or some other cpu limiting linux utility/script and test by giving the process a lower priority.
If you are not the host in question, why this shameless plug?
I think there was nothing shameless, if we share our technical knowledge publicly, that help somebody out of their hosting issues.
He was obviously refering to the need to help him in private.
It sound like the VPS is terminated due to high demand of cpu power overuse, probably limited by 5 min max usage.
I love the inappropriate bolding. I know a guy like you, instead of bold he keeps writing the occasional word in caps.
It's fucking annoying, and I told him it made him look like a cunt.
He told me that was rude, so I pointed out to him how I'd got my point across and made an impact without using caps.
I guess the morale of the story is that sometimes you have to tell people that they're a cunt to get them to stop being one.
Change the priority of the tasks, limit the cpu use as much as possible and when you are not generating a load of 20+ for 5 minutes I am sure it will be fine.
Also move the database over and do the import locally not over ssh no doubt with compression which will be adding yet more CPU time.
Or just don't use shithosts which randomly kill VPSes for CPU load.
It is not really a question of 'or'
Any host on shared CPU will only tolerate so much, by the sounds of it though he is using a host with some sort of node watch monitoring set on pretty ridiculous defaults, either that or he is generating a stupidly high load.
Sometimes for stuff like this, it is best to use shit/garbage hosts that don't care about the other customers you are impacting.
If nothing else works. Break the database file into smaller once and restore in batches
very strange, but such host trying to hold node stable as it's most likely heavily oversold.
much easier in this situation:
1) find better vps provider
2) change priority of the task, this way it will take longer but it least the VM will be up for more than 5 minutes.
You may also want to look at getting a cheap dedicated / virtual dedicated server, so you won't have to deal with stuff like this.
Or use xtrabackup instead of a SQL dump.
Changing priority you only modify the priority of it within your VPS. If there are no other tasks running in your VPS, it will still take 100% CPU -- and still make the host shutdown the VPS.
There are multiple options to solve a problem and I just gave one. For example, you may get a $15/year but it's ain't always works well. For cost, you may want to stay instead moving a an expensive one.
options cpulimit and nice can be used, more details: http://blog.scoutapp.com/articles/2014/11/04/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups
Especially cpulimit can be set to 50% and the task can be achieved.
Yes
cpulimit
will work, butnice
is again, just the VPS-side priority, and will behave like I described previously.ask your provider? for such small database it should not problem
my $15/y VPS able to import 2 GB DB without problem, so whats your point?
his provider using autoboot/autoshutdown feature which is annoying, that the problem/culprit
It can be as I have posted before the OP VM provider is overselling node and in order to keep it stable all VMs are terminated if they do use CPU at max for more than 5 mins.
That wasn't my point. What I mean is my solution was to if there's nothing else works for him and he's not interested in changing node/provider for whatsoever reason
Most likely the vps is hosted on a oversold server node, and when OP max out the resources for a prolongated period of time his VPS gets automatically rebooted or shutdown.