Hello,
I have exactly the same issue as #213260: Error 500: Premature end of script headers on Dreamhost except for that I am on my dedicated server and the load is less than 1.
I inject a watchdog in module_invoke_all and the last called functions are: trigger_forms, user_forms, ctools_forms, google_cse_forms. Then it is stuck for 30 seconds and returns with an 500 error.
The Apache error log is not very helpful
[Sun Mar 07 18:15:50 2010] [error] [client xx.xx.xx.x] Premature end of script headers: index.php, referer: http://www.example.com/
The site runs smoothly, each page is loaded in less than 1-2 seconds, but it throws this error on every page that is started with /admin. I don't know what else to debug.
Comments
Comment #1
jerdiggity commentedI just now re-opened (and then re-closed, after I saw this issue) #213260: Error 500: Premature end of script headers on Dreamhost -- has some "stale" content on it & I'd rather start fresh with this one.
Anyway, same exact problem (literally) as described above. Here's my post from the old issue:
Where it says "when logged in," just as described by jcisio's initial post, what I should have put was "when logged in as admin" instead. Gotta be a way to nail down why this is happening...
Comment #2
jcisio commentedTry to increase your PHP memory limit (I have 160 MB now) to see if it fixes that.
I still don't understand why a timeout problem (suphp timeout fires an 500 error) is related to a memory problem.
Comment #3
locomo commentedI was having the same problems running PHP as cgi .. i switched to mod_php and these errors went away
Comment #4
aren cambre commentedStarting to see these errors more on Dreamhost.
Comment #5
aren cambre commentedGot the reason: Dreamhost has a daemon called procwatch that terminates processes when they use too much memory. This has nothing to do with php.ini settings.
Dreamhost won't share how much is too much (for "security" reasons--bah!), but I guess it's somewhere between 130 and 145 MB.
Comment #6
jcisio commentedAren Cambre, will you file an issue in Drupal? Because it is not normal that a site uses 30 MB for install, 10 MB for each request but 150 MB for the admin page. It restricts the Drupal adoption.
Comment #7
aren cambre commentedHow do we monitor memory usage? The trick is we need to monitor memory usage in a way that we have stats that are collected before Dreamhost's procmon shuts down the process. Two possibilities:
We could simulate this on some other machine, but I'm not sure that it's possible to accurately mimic Dreamhost's memory usage on another system, especially since we don't know Dreamhost's precise configuration.
Comment #8
jcisio commentedI don't think any kind of monitoring can help. Admin pages use too much memory, which should not happen. I didn't test with CCK field, but the number of disable modules also counts. When PHP runs out of memory at 128 MB, I simply delete some unused module folders and it helps.
Comment #9
jerdiggity commentedHey guys...
I noticed there are a couple issues regarding this, and rather than clutter up the issue queue I thought it might be better (and easier) to kind of "consolidate" everything into a forum thread instead, so I started one here.
I also just now posted a link there to an askapache.com article I stumbled upon that might be relevant if anyone wants to take a look at it...
In the interim, I'd rather not mark this issue as Won't fix or Closed because then it'll disappear out of everyone's (visible) queue -- Fixed is probably the best choice (even though I know it's not) (fixed, that is) so people have a chance to "relocate" but as far as I'm concerned, it's your call jcisio.
Comment #10
jcisio commentedNo, this is a Drupal issue. Why admin pages use 5x-10x more memory than normal pages?
On DH you can modify your custom php.ini to increase memory limit, but your process is always killed soon by monitoring daemon.
Comment #11
nicow commentedHi,
So, anyone got any luck with this? I am getting this issue after installing the Category module, everythign was working fine before. I think I have tried almost all suggested fixes on all the 500 error threads that are around. Is there a workaround? Did someone fixed this?
Comment #12
Routh commentedI'm experiencing the exact same issues with the Drupal 7 core. The stie runs fine until I load an admin page, then no one can access it for 20 mins due to 500 errors with the same mod_fcgid timeouts and premature script ends. The PHP Memory limit had to be set to 160MB to fix it. This is way too high for a webpage. What's wrong here?
[Fri Jul 29 14:47:03 2011] [warn] [client 205.203.134.197] mod_fcgid: read data timeout in 40 seconds
[Fri Jul 29 14:46:54 2011] [error] [client 157.55.18.13] Premature end of script headers: index.php
Comment #13
sunComment #14
jcisio commentedHum, sun, does D7 have this issue ?
I keep it as a feature request to ask that admin pages use less memory ;)
Comment #15
LarsKramer commentedJudging from the comments here, it seems this problem is not a Drupal core problem, but more related to specific server settings and contributed modules:
See more on System requirements
So I suggest moving this discussion to the forums, or marking it as bug and providing some clear steps to reproduce. Feature requests generally go to HEAD (Drupal 8), unless they have already been fixed there.
Comment #16
jcisio commentedD7 requires 32 MB to *install*. I'm not sure if 32 MB is enough for normal usage. But there problem here is that Drupal uses 10x memory for admin pages.
Comment #17
Routh commentedMy VPS had 64 MB dedicated to it. We jumped it to 128MB dedicated to it before I posted my original issue. I now have 256MB dedicated and Drupal 7 runs smoothly. Finally.
I still get error 500's from the update script occasionally.
This is not a problem with reading directions. It is a problem with Drupal using an abnormally large amount of memory and processing power for a website, make no mistake.
Comment #18
LarsKramer commented@Routh: Does this only happen on your live server, or can you reproduce the same error locally or on another server with the same set up of modules?
I am sure performance and more efficient memory management will improve with Drupal 8. With Drupal 7 the focus was on usability.
However, Drupal's performance also depends on the modules you have installed and how well they are written.
Comment #19
Routh commentedIt happens on the dev server with the same limits. On the dev server I had to mimic the same memory settings to get optimal performance. Now admittedly I run a community site, so in hindsight some of my modules may be leading to it. However when troubleshooting I trimmed my active/installed modules down to the core modules to determine the cause. The two modules I find cause the most memory drain are the update module and views. Saving changes in views can still make the server chug a bit.
Comment #20
LarsKramer commentedThanks for the information Routh. Now, I would consider this a bug report, not a feature request, because you say you get some errors. If we want anyone to dedicate time solving this problem, I believe the first step is tracking down precisely what conditions or steps cause those errors so that it is possible for everyone to reproduce (for more info on providing reproducible steps, see How to make an issue report).
As I understand, you experience this problem with Drupal 7.4. Can you reproduce on your local development server with a clean standard profile install of Drupal 7.x-dev without any content, but with Views and Ctools installed? If not, I would suggest as a next step generating content and users with devel module (which I can easier reproduce).
The Views module, together with devel module, also has a set of tools for measuring performance, and debugging which you can enable under settings (basic + advanced).
Comment #21
Routh commentedOk, I will run through some installation scenarios in a couple weeks, currently have a lot on my plate with a job search and trying to iron out kinks with my live site, plus writing help docs for the users.
I also just want to mention that my DB size may be causing part of the problem. My site accepts novels and story submissions. A couple of these are close to 166,000 words in length. My db is currently 190MB (search index and caching included) according to MySQL.. so I suspect that this factor is playing a role in the system requirements of my site.
I will get back to this once I have more time to conduct some thorough testing on the dev server.
Comment #22
Anonymous (not verified) commentedComment #23
jcisio commentedIt is known that the admin pages might use 10x memory than a "normal" page, and causes problem. So I think it is a "won't fix" because thing changed so much between D6 and D7, then D8.