Yasser
Yasser

Reputation: 62

Have I outgrown the shared hosting or I my scripts aren't optimized?

I currently have more than 1000 visits / day and hosting at 1and1 with PHP memory 30MB limit I have a dynamic shopping guide with more than 5000 items and users enter to browse / search for items. I started getting "Internal Error 500" every now and then. Which are show more on days, and I don't notice them on others. 1and1 support say that I have outgrown the 30MB PHP limit. What do you think? Is that true? or they just want to sell me a more expensive hosting? I currently can't afford more than a shared host :(

I am using PHP / MySQL Javascript / My BB Forum / PHP thumbail (which I am now trying to switch with static thumbnails to ease the load a bit) Advice is appreciated

Upvotes: 1

Views: 198

Answers (3)

Yasser
Yasser

Reputation: 62

I have moved to another hosting "Blue Host" and the errors stopped ever since. It seems they handle the resources in a different way: "CPU throttling". And they told me I can use their services till I feel the website is slow and I then should switch to VPS or dedicated server. 1and1 handle the overload on shared limits with error 500. This is not good!

Upvotes: 0

Hans
Hans

Reputation: 3523

If you are bumping up against 30 megabytes of PHP memory (if you are in fact talking about the php memory_limit setting, which it seems you are), then most likely some optimization could solve it. I usually only hit that kind of number if I'm processing large arrays and/or converting to PDF files, etc. And then I usually figure out a way to drop the array size by using memcached or writing the PDF some other way or something like that.

Sometimes the easiest thing to do is to buy their upgrade. Throwing hardware at the problem can at least be a quick fix. If you are making money from your web site, any time you get a 500, you could be losing money so it might be wise financially for you. But, you didn't ask that question. :)

To determine how much memory your scripts are using, sprinkle https://www.php.net/memory_get_usage around at strategic spots to see (assuming you don't have a profiler that can handle this better).

Upvotes: 0

Neil
Neil

Reputation: 3041

It's very unlikely that disk space constraints are causing 500s, even with 5000 items over 30mb, that's roughly 6k per item - only probably if each item has an image.

When you reach your disk quota, most PHP frameworks will report an error themselves, rather than sending a bog standard 500 response, so the 30Mb limit is almost certainly not the problem. Your hosting company may have other limits they're imposing, but even 1000 visits a day shouldn't break the most draconian hosting thresholds. It's more likely that your hosting company are looking for an easy up-sell.

Give us a URL and maybe we can get a clearer picture, but it's more likely something is simply broken in your site's code. Of course, without any reference material, this is strictly a theory.

Upvotes: 1

Related Questions