If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

PHP / CGI script returns no results on Apache RLimitMEM & RLimitCPU

12-14-2004, 03:14 AM

A note to Zoom users that use the PHP or CGI version of Zoom on servers that run Apache.

Several users have reported a problem where they do a search and get no results. In some cases the search form is still displayed at the top of the page, in other cases you get a completely blank page.

After investigation it seems that some shared hosting companies are severly limiting the amount of RAM and CPU available to PHP and CGI scripts.

They can do this by setting the "RLimitMEM" & "RLimitCPU" directives in the Apache configuration for the server. Setting these values will cause Apache to kill any script after it uses more than a certain amount of RAM or CPU time.

These values are normally set in the Apache httpd.conf file. (but can also appear in the srm.conf, access.conf and virtual host files)

The solution is to get you hosting company to set reasonable limits for these values. Of course they might not like this becuase it means you are going to be using more of their CPU time and RAM.

The larger your index files in Zoom, the higher these limits will need to be. Example limits for a medium sized site might be,
RLimitMEM 32097152 32097152 #32 Meg of RAM
RLimitCPU 20 60 #60 seconds of CPU time

But before you start sending your hosting company nasty E-Mails check everthing else is correct.
- Check the the indexing process was successful
- Check that all files are on the server
- Check that you can run other small PHP scripts.

Note that if you have this problem, then there will be no error message of any sort, but you will see the search form. This is becuase the script was suddenly terminated. If you see an error message then these settings are probably not the cause of your problem.

--------
David
Wrensoft

Update: Oct 2005: If you are able to confirm with your hosting company that CPU run time is the problem and you are using PHP, then consider switching to the CGI option which will use less CPU time and give faster searching.

I have this very problem where there are no search results posted on the search form.

The search engine is working fine one day, and then a few days later it isnít.

There is no apparent problem with the search files. They have been uploaded more than once, but no change. The search engine (with these search files) works fine on my home computer using a server application.

I showed the RLimitMEM and RLimitCPU posting to my server webmaster, but he says that cannot be the problem, that the server values are much more than enough.

He says they are using this configuration (which, admittedly, means little to me):

Dul 2.8 w/4 GB ram

Fedora Core 2

php 4.3.8

I am using Zoom Professional 3.1, I think (I donít have it here for checking); I bought it last May.

The server webmaster suggested that I enable error-logging --- how do I do this, and will it help since there are no errors reported?

Comment

There are still a few people seeing this issue. So I wanted to post some additional details here.

There are a number of cheap hosting companies that paid peanuts & employ monkeys to do support. These companies often deny there are any limits on their servers.

This is a very simple script which should reach a count of 9,000,000. If it stops before this then the script's execution must have been terminated by something on the server. This would indicate that it is a problem independent of the Zoom search script.

Comment

Thanks so much for the software (at a great price)
After running the script and only getting allocated memory for 130000 integers, (On our dedicated server) I was able to look at the limites tab and noticed it had changed from the default of 1024kb to 10240kb.. That did not work

So as we have the search running on 2 different parts of our site, I loaded the settings fromt he working search, and just changed the web folder.. reran the index and now I do get how many results it found but nothing listed under that.

I now need to look into changing the limits but have no clue how to access the httpd.conf file.

I am just not sure why it doesn't work on one part of the site but it does on the other... (php shopping cart side works, html old site does not(but did)

Thanks again for the professional and quick reply to my email,
Jason Miller

Comment

I believe it is possible to modify RLimitMEM and RLimitCPU via .htaccess if the Apache server is configured to allow this. However, this is a highly unlikely setting unless you are on a dedicated server. This would otherwise mean that any account on your shared server may be requesting to use 100&#37; CPU or all available RAM, and the server is unlikely to handle this. If they maintain that you can control this, they should be able to tell you how to do so. The syntax should otherwise be the same as the setting in the php configuration file.

Alternatively, they might be thinking of the memory limitation for PHP which is more commonly available for user control in .htaccess as described in this FAQ. This limit is applied prior to the Apache limit, which means that even if you have this limit allowing for 32MB of memory, if there is an Apache RLimitMEM set to 4MB, you will still be restricted to 4MB. It would be worth checking however, if it is the PHP limit that you are running into or the Apache one. The PHP limit should normally report an error message (eg. ""Fatal error: Allowed memory size of 8388608 bytes exhausted..." or similar) either on the page itself or in the server logs.