Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:03:32+00:00 2026-06-16T22:03:32+00:00

I have a very slow home server (raspberry pi) with 700 MHz CPU. When

  • 0

I have a very slow home server (raspberry pi) with 700 MHz CPU. When I develop some sites, it sometimes happens that I input a large (5 MB) .jpg file into an image resizer (imagecreatefromjpeg(), imagecreatetruecolor(), imagecopy()) which causes the server to hang.

I’d say it’s processing the file, but even when I wait for minutes, it never ends.

The problem is that I cannot even access the shell to stop/restart apache2; the only solution is to power off the server completely.

I was wondering whether there’s any way to limit HW resources for apache2; for example if I could limit only 80% CPU usage for it, maybe I could still access the shell and stop it.

I tried setting the timeout and max_execution_time directives, but they don’t seem to stop apache2 from working infinitely and freezing the server.

Any ideas how to solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:03:34+00:00Added an answer on June 16, 2026 at 10:03 pm

    I don’t think you can limit the cpu usage of apache from its own settings.

    You can try using a separate app like cpulimit (see: how-to):

    $ sudo apt-get install cpulimit
    $ man cpulimit
    

    You can also try these to optimize the overall performance of your server.

    • Edit your /etc/apache2/apache2.conf and use these values:

      <IfModule mpm_prefork_module>
          StartServers          2
          MinSpareServers       2
          MaxSpareServers       3
          MaxClients           50
          MaxRequestsPerChild   0
      </IfModule>
      
    • Expand your swap in /etc/dphys-swapfile set:

      CONF_SWAPSIZE=512
      

      Then run:

      $ sudo dphys-swapfile setup
      $ sudo dphys-swapfile swapon
      
    • Overclock your raspberry (it’s safer than it sounds) here:

      $ sudo raspi-config
      

      I use it at 950MHz. There is a higher option (1000MHz), but some people on the forum complained about SD corruption with that one.

    • You can also set the graphic memory to 16 in raspi-config memory_split if you do not use the graphical interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dedicated server that hosts about 70 domains... some are just plain
I have a very slow query that is built by the ORM and I'm
I have a view that is very slow: ALTER view [dbo].[TAT] as WITH d
I have a (probably) very slow and inefficient collage that I generate on a
I'm trying to do some very simple page redirection on a shared server that
I have noticed that my site in Cakephp is very very slow. I have
I have this MySQL query that is very slow, I presume because of all
I have a very complex SQL View. My Problem is, that its very slow
We have a couple of very very slow JUnit tests that make heavy use
I have a large database of normalized order data that is becoming very slow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.