my account got suspended by just importing an xml database in wordpress

Status
Not open for further replies.

bhavinkhatri

New Member
Messages
4
Reaction score
0
Points
0
Hello,
From wordpress, its allowed to import XML database upto 16 MB of size.
Now, i just uploaded only 3 MB database and my account got suspended.
The message i got was over-usage of CPU. But its not in my hand when i upload any XML database.
Could you please light upon this!

Other than downtime due to Ddos attack, i found X10hosting very good as a free hosting provider.
Thank You.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Is it possible to break that XML database down into smaller chunks less than 3mb and import them separately? The issue with the wordpress import-database function is it's not normally meant to work on shared hosts where there's a cap on how much CPU you can use - chances are during the import, it's maxing out the CPU for the maximum execution time, which is -bad-.

If there's a way to break down the database into smaller chunks, say, 2mb in size, you could easily import one, wait a minute or two, import the next, repeat until complete. Otherwise I'm not sure of an effective way to import a database that large in one shot because of the cpu limit :(
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Most of the downtime or slow service you see here isn't from DDoS attacks, it's from users' own websites hogging resources. (Yes, Starka has had recent problems with a DDoS, but that's not the usual reason for slowness or apparent downtime.) There are a lot of user sites on each of the free hosting servers, and it's probably fair to say that very few of them are static HTML sites. Most use some form of server-side processing at least at service time; many use a database back end (certainly most forums and blog/CMS sites do). Some use AJAX/AJAJ to update pages while the viewer sits on them, increasing the number of requests and the processing used. And, let's face it, some are not particularly well-written bits of code that take more CPU, memory and SQL requests than they need to do what they do. That means that even when nobody is breaking any rules, the servers can be quite busy at times -- and there are a lot of people who just don't seem to think that rules or the idea of fair play should apply to them.

Now, importing an XML file doesn't sound like it's a very big deal, but it certainly can be. That 3MB XML file becomes a much larger hierarchical DOM tree. It will easily stay within the memory limit, but it's not a simple 3MB chunk of text anymore. The larger the XML file is, the larger the DOM tree becomes, and the deeper the elements in the XML file are nested, the more complex the DOM tree becomes. Wordpress then needs to parse the tree into individual rows -- each XML entry may become multiple rows spread across multiple tables -- and call a SQL insert for each of the rows it creates. This doesn't come at zero cost computationally; it takes CPU cycles, memory space and SQL queries to accomplish the task. If it were running on your own private machine (or on a VPS), you'd be limited only by the available resources on your machine. On a shared server, your import has to share time and space with other users on the same machine. It's okay if you take a big bite of the resources for a very short time -- it doesn't appreciably affect the response time of other users' sites. But if you continue to use that level of resources over any appreciable length of time, you are creating the conditions you've described as a "DDoS" on everybody else's site on that server. That is, the server becomes unresponsive to web requests because it's busy handling your import. That's why there's a limit on resources, and why your site got suspended. The server has no way of knowing whether you're doing a one-time update that's going to finish in a couple of extra seconds, or whether it's just run into a particularly nasty bit of code that's going to be doing this all day, every day.

Try breaking your XML file into smaller chunks and doing multiple imports. It will still take the same peak CPU, but the duration should be short enough that it doesn't trigger the resource limit suspension.
 
Last edited:

bhavinkhatri

New Member
Messages
4
Reaction score
0
Points
0
thank you for the reply Livewire.
And wow, that was a detailed info in your reply, essellar!
I never knew 3MB file could hog huge resources. Actually I was amazed to see that here I can import upto 16MB, as my previous free host allowed only 1.5 MB.

Thank You.
 
Status
Not open for further replies.
Top