1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Internal Server Error

Discussion in 'Apache' started by Fishhhead, Mar 26, 2016.

  1. #1
    Users of my website will randomly and intermittently receive an Internal Server Error. The error message is:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


    The error occurs without any pattern, it is not predictable, any link on the site can generate the error, as can simply going to the site. When the error appears, simply refreshing the page will take you to where you wanted to go.

    In the server error log a message will be generated that looks like below:

    [Sat Mar 26 15:29:52 2016] [error] [client 75.111.23.20] File does not exist: /home/lfps42un/public_html/500.shtml, referer: http://www.mysite.com/cgi-bin/auction/auction.pl?action=postwanted

    [Sat Mar 26 15:29:52 2016] [error] [client 75.111.23.20] (12)Cannot allocate memory: couldn't spawn child process: /home/lfps42un/public_html/cgi-bin/auction/auction.pl, referer: http://www.mysite.com/cgi-bin/auction/auction.pl?action=postwanted


    My site is an auction for the commercial fishing industry. It is written in Perl and is located in cgi-bin. It has been up and running since 2011, but the problem with the error messages began a couple of months ago. Data is stored in both text files and mysql database with PHP links. The error log message above was generated by attempting to access a page that connected to the database, but the error can occur while attempting to access another Perl script also.

    I rent space on a server and the folks at Tech Support tell me everything looks good and all is working properly. They have been no help.

    I am looking for suggestions on what could be causing this and ideas on how to fix it.

    Thanks.
     
    Fishhhead, Mar 26, 2016 IP
  2. Bitpalace

    Bitpalace Greenhorn

    Messages:
    53
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    13
    #2
    You are clearly running out of RAM. You can either reduce the amount of RAM that your auction.pl Perl script uses or you must upgrade the server package that you are leasing from your web space provider.
     
    Bitpalace, Mar 27, 2016 IP
  3. Fishhhead

    Fishhhead Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks for the response. I went to the cpanel searching for information on the amount of RAM allocated to my site. I did not find it, but there is a log showing usage information. CPU usage general ran around 50% (but no indication on how much is available), however Virtual Memory has a limit of 1 gig. Interestingly this limit was often being exceeded and generating "faults". What was strange was these periods when the the maximum were being exceeded often occurred in the middle of the night locally.

    I seriously doubt any fishermen were up at those hours looking at my site. So a couple of questions:
    1) Would exceeding the virtual memory limit generate the Internal Server Error when someone was using the site?
    2) Could this type of activity be caused by bots or some sort repeatedly hitting my site?

    Pete
     
    Fishhhead, Mar 27, 2016 IP
  4. Zoti Media Group

    Zoti Media Group Notable Member

    Messages:
    1,598
    Likes Received:
    113
    Best Answers:
    2
    Trophy Points:
    265
    Digital Goods:
    2
    #4
    Increase the memory in php.ini or via .htaccess.
    This is caused due to some plugins, someone attepts to hack your site (sending bots) or you are getting to much traffic. Its hard to answer what could it causing without showing logs and inspecting the processes.
     
    Zoti Media Group, Mar 27, 2016 IP
  5. Fishhhead

    Fishhhead Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Thanks, my memory settings for PHP are: memory limit 512 meg, post max size 64 meg, and upload max file size is 32 meg. These are the highest settings my server allows.

    There are no plug-in on my website. There are roughly 100 registered uses for the auction and I get 25-50 hits per day. So plug-ins and high traffic do not appear to be the cause. That leaves getting hit by bots causing the spike in virtual memory use.

    Now, are the spikes in virtual memory related to the Internal Server Error the users experience, or are these unrelated coincidences.
     
    Fishhhead, Mar 27, 2016 IP
  6. Bitpalace

    Bitpalace Greenhorn

    Messages:
    53
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    13
    #6
    With all respect, I have a question about this one of yours: What did you not understand of our post "You are clearly running out of RAM."? You are running out of memory. It is that simple.

    For whichever reason. Maybe your server is experiencing brute-force attacks, maybe a backup process on the host machine is consuming too much RAM so that your 1 GB is left to a theoretical value only, maybe your script occupies RAM and is running a long while, then the next instance starts, then another and so on, so that after only a few parallel script runs all RAM is used up ... who knows?
     
    Bitpalace, Mar 28, 2016 IP
  7. Fishhhead

    Fishhhead Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    Bitpalace, I get it, I am running out of RAM.

    Recall that my site has worked well since 2011, but the errors began showing up a couple of months ago. So the question I ask my self is why am I running out of RAM now. There have been no significant changes in the site for over five years. Why now. When I noticed the anomalies in memory usage with spikes occurring in the middle of the night, I wondered if this could cause the error problem. If the answer is no, those spikes pass within seconds or minutes and has no relationship to usage occurring hours later, then I would look to another reason as to why I am all of sudden running out of RAM.

    The folks that handle Tech Support for the server have been of no help. That alone my be justification to moving elsewhere, but then that is a different issue.
     
    Fishhhead, Mar 28, 2016 IP
  8. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #8
    If I read this thread correctly, you have only 1 GB of RAM? That is not enough these days. It could be a number of things causing the problem. Programs and operating systems rarely use less memory as time goes on, so you may not have had a problem years ago but do today. That part makes sense. System maintenance processes, cron jobs, and such typically run at night. So maybe they are exhausting your RAM (as was previously mentioned).

    You could look at your logs and if you see any bots hammering your site, you could block them. I know the br@ndw@tch bot would make 8 - 9 page requests per second on a site of mine years ago. And depending on what timezone you are in, search engine bots may be crawling your site at night.

    If you are determined not to upgrade your service (which would be the best option), you could try limiting MySQL memory consumption or checking the number of Max Servers your Apache is not too high. I am assuming you are on a VPS but all you say is you rent space on a server. I don't know what configuration options you have available to you.
     
    billzo, Mar 28, 2016 IP
  9. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #9
    As others have pointed out, the fact that your site was working fine, but isn't working fine now, might be because of several different reasons. First things first: is this a shared hosting server? If it is, it might not be your scripts, or your server using the resources - maybe it's one of the other sites (or several of them) hosted on the server creating problems. If it's a VPS/single site host, then perhaps the increase in resource usage is because of outdated scripts, running on new/updated server-software? Depends on when your site was made, how it was made and so on. There can be so many reasons - however, from what you're saying, even your limited resources should be more than enough to run such a site - the total number of users is very low, so it might be that something is broken on the server/website, creating lots of requests, and not freeing them up afterwards - very hard to say since we don't have access to logs.
     
    PoPSiCLe, Mar 29, 2016 IP
  10. AlphaNine_Vini

    AlphaNine_Vini Active Member

    Messages:
    218
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    88
    #10
    Check for any error_logs that is utilizing a lot of disk space. Sometimes error_logs utilize a lot of disk space causes memory issues.
     
    AlphaNine_Vini, Mar 31, 2016 IP