News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PHP Process using 500-600Mb of memory

Started by snadge, January 23, 2014, 04:49:21 AM

Previous topic - Next topic

snadge

We are running SMF 2.0.7 (just upgraded to 2.0.7 last night) and we have recently moved to a new host (TSO 'Shared' Hosting) and since moving to these hosts we have been getting the occasional 500 Internal Server Error page - refreshing the page brings it back online, this happens randomly to my forums users, we never had this issue with EZPZ 'Shared' hosting before them or HostXnow 'Shared' Hosting before that, they have blamed it on a few different things but now have located the issue and say that a PHP process on our forum is using 500-600Mb of memory and thus breaking the 500Mb 'limit' applied to shared hosting users??? - thing is if this was the case then simply refreshing the page would not fix it would it?

also the Cpanel logs show green ticks next to memory usage which says 13% and Page-File is 0.1%

they say they have increased our "per-process limit" to 800Mb and if it breaches that then we need dedicated server hosting????

this is a forum with 2-4 regular users...

we have following 22 packages installed: (we can not remove EZPortal without help and thats why its installed with Simple Portal as we use SP)

Quote1.   SMF 2.0.7 Update    1.0
2.   SMF 2.0.5 Update    1.0
3.   SMF 1.1.19 / 2.0.6 Update
4.   EzPortal    0.5.2
5.   Dizzy Smileys    0.5.0.1
6.   Pretty URLs    1.1.1
7.   Aeva ~ Auto-Embed Video & Audio    7.2
8.   Stop Forum Spam    1.0
9.   Spiders Don't Increase Topic Views    1.1.1
10.   httpBL    2.5.1
11.   Button 1 Menu Extender for 6 custom buttons mod    1.0
12.   Pretty URLs    1.0

14.   Menu Editor Lite    1.0.5
15.   Stop Spammer    2.3.9
16.   SMF 2.0.2 Update    1.0
17.   Adk Topic Private    1.0
18.   SimplePortal    2.3.5
19.   Email Template Editor    1.0
20.   SMF 2.0.3 Update    1.0 

22.   SMF 2.0.4 Update    1.0
23.   Pretty URLs    1.1

25.   Christmas Smileys    1.1

if anyone could help locate whats causing this issue it would be great

we did have Tapatalk installed until last night too - I uninstalled it and asked the hosts if there was any difference to RAM usage but waiting a reply from them... I was sus that it might be that as we had some issues with it...at least we thought it may be the problem but unsure.

thanks

margarett

This is what I wrote yesterday about the amount of memory your host says you have. Just replace 256M with 500M and the context is the same:
Quote from: margarett on January 22, 2014, 04:25:00 PM
I'm sorry, but that can't be true, and that is *exactly* what this topic is about... They say you have a certain limit (as you can check with phpinfo) but, in reality, you have far less memory available.

Just think about it for a moment. You have 256M. Those oversold servers are known to host *hundreds* if not thousands of accounts. Just do the math and think on the amount of memory necessary...
Of course not all clients have the same demand so it is possible to share. But that's a really high value. You are able to run SMF perfectly with 64M, if not 32M!

But, I don't think yours is an overseller (no "Unlimited" stuff on their site is a good sign).

Also, when I'm doing some coding in my test forum, I sometimes screw up (well, most of the times :P ). When this happens I get a pretty log in my PHP error log telling me exactly what caused that. And I don't get a 500 error, I get a blank page because I caused a PHP error. Specifically a "memory exhausted" one:

Allowed memory size of X bytes exhausted (tried to allocate Y bytes)


It is entirely possible that something in your forum (since it's not a vanilla installation) is really causing too much memory to be used. But you should be able to know *exactly* what it is.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

I have only one ever seen PHP need 500MB of memory, and that was dealing with a GIF image that was 12000 pixels high and 12000 pixels wide. I would love to know what URL was going on when that happened.

snadge

what happened to your post then? i cant see it?

i thought the same as you... our host has good rep and reviews, but I to thought that if it was PHP then it would fail and state error with the code rather than 500 - but they are saying thats due to limits kicking in? if limits kicked in wouldnt it keep the forum under until the memory usage came down? cos simple F5 fixes the issue

Arantor

What, the 12000x12000 GIF? That wasn't in SMF, that was something I did a number of years ago, but I've *never* seen PHP eat that much memory under any other circumstance anywhere, not in years of using SMF.

That's why I want to know what the process was doing to require that much memory because I can't think of a single operation in SMF that would.

snadge

how can I inform them to tell me which process it is? because they dont seem to know?

anything I can access in Cpanel?

Arantor

So they're telling you there's a problem but can't even tell you on what URL the error occurred. Sounds like *great* hosting to me. Not.

snadge

it can be any page - happens now and again, also clicking F5 the page reloads successfully?? happens with all my users on odd occasions?

surely if its 'limiting' for 500Mb memory usage then the site would not be accessible until we went below the limits yes? well this is not what happens... we just get random 500 Internal Server Error faults

I really need to get too the bottom of this so any help would be great.

Arantor

I don't think you understand what I'm saying. I think I confused you by giving you an example to try and explain.

In normal usage, memory won't even go much above 8MB for a page load. For some operations (packages, attachments), I've seen it legitimately go to 100MB. I have NEVER seen SMF ever go to 500MB for a single page load. There is no situation where SMF will ever request that much memory.

The most memory SMF ever requests is 256MB. And that's under very specific and rare circumstances.

If it's going to 500MB something very strange is going on.

snadge

this is what they said other day that they are seeing in the logs:


Jan 22 13:37:13 defiant lfd[11830]: *User Processing* PID:11737 Kill:1 User:techtalk VM:527(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:37:13 defiant lfd[11830]: *User Processing* PID:11765 Kill:1 User:techtalk VM:561(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:37:13 defiant lfd[11830]: *User Processing* PID:11706 Kill:1 User:techtalk VM:578(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:39:13 defiant lfd[13446]: *User Processing* PID:13291 Kill:1 User:techtalk VM:625(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:39:13 defiant lfd[13446]: *User Processing* PID:13300 Kill:1 User:techtalk VM:629(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:39:13 defiant lfd[13446]: *User Processing* PID:13289 Kill:1 User:techtalk VM:627(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:39:13 defiant lfd[13446]: *User Processing* PID:13302 Kill:1 User:techtalk VM:600(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:39:13 defiant lfd[13446]: *User Processing* PID:13241 Kill:1 User:techtalk VM:618(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:41:13 defiant lfd[15078]: *User Processing* PID:14941 Kill:1 User:techtalk VM:573(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:41:13 defiant lfd[15078]: *User Processing* PID:14919 Kill:1 User:techtalk VM:631(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:41:14 defiant lfd[15078]: *User Processing* PID:14937 Kill:1 User:techtalk VM:580(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:41:14 defiant lfd[15078]: *User Processing* PID:14922 Kill:1 User:techtalk VM:593(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:41:14 defiant lfd[15078]: *User Processing* PID:14916 Kill:1 User:techtalk VM:618(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:42:22 defiant lfd[16718]: *User Processing* PID:15937 Kill:1 User:techtalk VM:507(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:42:22 defiant lfd[16718]: *User Processing* PID:15857 Kill:1 User:techtalk VM:567(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:42:22 defiant lfd[16718]: *User Processing* PID:16049 Kill:1 User:techtalk VM:550(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:42:22 defiant lfd[16718]: *User Processing* PID:16176 Kill:1 User:techtalk VM:528(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php
Jan 22 13:42:22 defiant lfd[16718]: *User Processing* PID:15863 Kill:1 User:techtalk VM:510(MB) EXE:/usr/bin/php CMD:/usr/bin/php /home/techtalk/public_html/index.php

Arantor

Do their logs give you anything useful like the URL causing the issue (since everything runs through index.php) ?

Advertisement: