0

I have a Linux webserver (Ubuntu 12.04, kernel 3.2.0) running Magento with quite a number of PHP-FPM child processes.

Since Magento is a heavy framework, I often see several child processes to baloon in CPU% (when viewed using htop) for several seconds before dropping out of the top N.

I have been reading about Linux CPU schedulers, and what I got was that SCHED_BATCH seems to give longer timeslices to processes than the default SCHED_OTHER.

Would it be beneficial if I change the schedulers for all PHP-FPM processes to SCHED_BATCH? Or am I misunderstanding the schedulers?

pepoluan
  • 4,918
  • 3
  • 43
  • 71

1 Answers1

1

After learning a little about SCHED_BATCH, I wouldn't even attempt to benchmark it:

SCHED_BATCH also triggers much longer, batch-like timeslices - the default SCHED_BATCH timeslice is 1.5 seconds.

SCHED_BATCH was clearly designed for very long running (hours or even days) compute-intensive jobs. Your jobs are only compute-intensive for seconds or fractions of seconds.

This pretty much makes it a no-go for a web server. And it would be worse if the database is on the same machine, as they might contend for one of those extra-long timeslices.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Ah, thank you! Now _that's_ the definitive answer I've been searching for and failing to find! I'll leave them at SCHED_OTHER then :-) – pepoluan Jul 02 '15 at 16:27
  • 1
    If you want to performance tune your Magento installation, you might want to visit our sister site, [magento.se]. – Michael Hampton Jul 02 '15 at 16:27