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 517537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:50:39+00:00 2026-05-13T07:50:39+00:00

When executing proc_nice(), is it actually nice’ing Apache’s thread? If so, and if the

  • 0

When executing proc_nice(), is it actually nice’ing Apache’s thread?

If so, and if the current user (non-super user) can’t renice to its original priority is killing the Apache thread appropriate (apache_child_terminate) on an Apache 2.0x server?

The issue is that I am trying to limit the impact of an app that allows the user to run Ad-Hack queries. The Queries can be massive and the resultant transform on the data requires a lot of Memory and CPU.

I’ve already re-written the process to be more stream based – helping with the memory consumption, but I would also like the process to run a lower priority. However I can’t leave the Apache thread in low priority as we have a lot of high-priority web services running on this same box.

TIA

  • 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-05-13T07:50:40+00:00Added an answer on May 13, 2026 at 7:50 am

    In that kind of situation, a solution if often to not do that kind of heavy work within the Apache processes, but either :

    • run an external PHP process, using something like shell_exec, for instance — this is if you must work in synchronous mode (ie, if you cannot execute the task a couple of minutes later)
    • push the task to a FIFO system, and immediatly return a message to the user saying “your task will be processed soon”
      • and have some other process (launched via a crontab every minute, for instance) check that FIFO queue
      • and do the processing it there is something in the queue
      • That process, itself, can run in low priority mode.

    As often as possible, especially if the heavy calculations take some time, I would go for the second solution :

    • It allows users to get some feedback immediatly : “the server has received your request, and will process it soon”
    • It doesn’t keep Apaches’s processes “working” for long : the heavy stuff is done by other processes
    • If, one day, you need such an amount of processing power that one server is not enough anymore, this kind of system will be easier to scale : just add a second server that’ll pick from the same FIFO queue
    • If your server is really too loaded, you can stop processing from the queue, at least for some time, so the load can get better — for instance, this can be usefull if your critical web-services are used a lot in a specific time-frame.

    Another (nice-looking, but I haven’t tried it yet) solution would be to use some kind of tool like, for instance, Gearman :

    Gearman provides a generic application
    framework to farm out work to other
    machines or processes that are better
    suited to do the work.
    It allows you
    to do work in parallel, to load
    balance processing, and to call
    functions between languages.
    It can be
    used in a variety of applications,
    from high-availability web sites to
    the transport of database replication
    events.
    In other words, it is the
    nervous system for how distributed
    processing communicates.

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

Sidebar

Ask A Question

Stats

  • Questions 269k
  • Answers 269k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's definitely a well-known bug - see here, here, and… May 13, 2026 at 1:22 pm
  • Editorial Team
    Editorial Team added an answer you tried parent.? May 13, 2026 at 1:22 pm
  • Editorial Team
    Editorial Team added an answer You state that according to the documentation, it's supposed to… May 13, 2026 at 1:22 pm

Related Questions

I am using oracle 10g express edition. It has a nice ui for db
When executing the following using a smalldatetime constraint on the returned results, I get
A client has reported repeated instances of Very strange behaviour when executing a stored
I'm having trouble executing a stored proc... I've got C# code that tries to
I am developing an application in Spring Web MVC where i need to execute

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.