Saturday, November 18, 2017

Yet Another Peril of Shared Hosting: Process Limits

So: I've been using Hostgator (not a referral link, I just like them) as my web host for lo on 15 years now, and occasionally blog about problems that come up and how to solve them. I think I've solved a new set of them after an informative chat with their tech support.

For the last several months (at least), the admin sections of my Wordpress sites have slowed down and started throwing off an unusual number of 500 server errors. It wasn't that bad for me, but it seemed to be really bad for Steve when he was trying to enter content for Rational Review News Digest, and it would be worse for both of us when I was online at the same time, proofing and scheduling items as quick as he entered them.

So, Hostgator (and lots of other hosts) like to advertise "unlimited storage" and "unlimited bandwidth" for shared hosting accounts, and that much is true. A little less well known is the limit on CPU capacity. That is, your sites are on one computer with several other people's sites, and your site can't be allowed to hog the resources in terms of CPU capacity. If I recall correctly, the user limit is 20%. That is, if your sites are using more than 20% of the CPU's available cycles for more than a short time, Hostgator is going to come down on you. It usually starts with a warning message letting you know there's a problem, and shortly thereafter people visiting your sites get a "suspended" message instead of the sites themselves.

A pat on the back to Hostgator: The last time the above happened to me, it was obvious that I was under a DDoS attack or the equivalent. There were suddenly thousands of content requests coming in (direct to the server, not through my Cloudflare DNS proxies) for no apparent reason. The database queries hogged up processor cycles. I got the warning message, took a look, got on support chat, and within minutes Hostgator agreed that that was the problem and did something about it instead of shutting down my sites and expecting me to deal with it.

That wasn't the problem this time. In tech support chat I learned about another limit that you don't see in the big up-front "unlimited storage, unlimited bandwidth" promotional language. That's a limit on the number of processes that can be going on at a time, each "process" being whenever one of your programs is doing something that talks to the CPU.

This isn't a limit on how much of the CPU's power is being used, it's a limit on how many things can be using that power at one time. At Hostgator (and at a couple of other hosts I was able to find information on this from), the "process limit" is 20-25. Go above a "soft limit" of 20 and weird stuff starts happening. Things slow down. Users start seeing "500 Server Error" messages.

The biggest culprit for bloated process numbers in Wordpress sites, my Googling told me, are the "plug-ins" that do various things. Every one of those plug-ins that does something every time a page is displayed will create additional processes. I spent quite a bit of time yesterday going through various plug-ins, thinking about how resource-intensive they might be in terms of processes, and ditching the likely resource hogs I could live without.

In particular, I ditched a really cool plug-in that I suspected was using all kinds of resources and that hadn't produced results I had hoped for -- not because it didn't do what it does, but because apparently nobody cares. That plug-in is called Transposh. Every time I wrote an article at The Garrison Center, it would automatically create versions of that article in a crap ton of other languages. Looking through my stats, I didn't see any people visiting the versions of my articles that were in Tagalog or Hungarian or whatever, so I axed it ... and suddenly my process count was way down and all of my sites were running the way they should be.

So: If you're noticing slow Wordpress site behavior or getting 500 errors, check out your "processes" and look at your plug-ins. There are lots of neat plug-ins that do lots of neat things, but they don't do those things with magic, they do them by acting as processes that use CPU power. If your web hosting uses the popular cPanel admin tool, you can find your process usage over in the left sidebar:

Thursday, November 16, 2017

"For the want of cheap aluminum foil, your burrito was not lost exactly, but made more expensive for no good goddamn reason."

"Other than political pull and the economically illiterate policy decisions of President Donald Trump." -- Reason's Nick Gillespie on the latest tariff idiocy

The Only Place Where You're Entitled to a "Presumption of Innocence" is in Court

I've been seeing a lot of the following lately, and I know MamaLiberty won't take it personally that I'm using her version of it. I'm singling her out solely because it's an opportunity to send people to her excellent blog, The Price of Liberty. At which she says, in the customary "Mama's Note" on a post by Nathan Barton about "dealing with predators":

Innocent until proven guilty, by a jury of one's peers. Too much of this sexual "scandal" is built on unproven accusations, especially those being made after decades.

People accused of crimes are entitled to a presumption of innocence 1) in court, 2) by the judge for procedural purposes, and 3) by the jury until they've heard the evidence.

Nobody else is entitled to a presumption of innocence anywhere else or by anyone else.

Nobody else is entitled to "proof beyond a reasonable doubt" to shatter any such presumption anywhere else or by anyone else, either.

Most people, I suspect, make snap judgments about the guilt or innocence, the rectitude or reprobateness, the purity or evil of other people all the time, all day long. Those snap judgments may or may not be correct. They may or may not be well-informed. But they, and the other judgments we make as we learn more following our first reactions, are natural and necessary.

If I'm told that someone I know or know of is a thief, I may want to know more before fully believing or fully dismissing the accusation, but deep down I'll almost certainly do one or the other, at least provisionally, based on my experiences with and observations of that person, based on my perception of the accuser's credibility, etc. It's good to be as certain as possible, but I don't owe the accused any presumptions unless I'm wearing a black robe or a a juror's badge.

Three Column Modification courtesy of The Blogger Guide
Some graphics and styles ported from a previous theme by Jenny Giannopoulou