Lapinskas / roadrunner-ubiquity

RoadRunner and Ubiquity integration
MIT License
9 stars 3 forks source link

Update request #20

Closed jcheron closed 4 years ago

jcheron commented 4 years ago

There is a performance issue since version 1.0.4 It's 6 times slower (with techempower benchmarks) Maybe a problem with the session: I made its start conditional.

Lapinskas commented 4 years ago

Merged

Lapinskas commented 4 years ago

There is a performance issue since version 1.0.4 It's 6 times slower (with techempower benchmarks) Maybe a problem with the session: I made its start conditional.

Hi @jcheron,

I have included your PR in the release 1.0.7 and benchmarked it using AB. I have not seen performance issues that you've reported.

Some areas that might need your attention:

jcheron commented 4 years ago

It's resolved, it was indeed the session.

However, the prepareSession method called at each request is too time-consuming. It might be better to create a session specific class for RoadRunner inheriting from AbstractSession.

You will then be able to pass an instance of this class at server startup with Startup->setSessionInstance($rrSession)

jcheron commented 4 years ago
  • Make sure you have numWorkers equal to 10 or other value in your .rr.yml. If it's set to 1 for debug purposes, you will have just one worker that will result in significant performance degradation.

For the number of workers, I initialize an environment variable with nproc*2 and I refer to this variable in .rr.yml

http:
   workers:
      pool:
         numWorkers: ${NUM_WORKERS}
         maxJobs: 0
  • Make sure you have no XDEBUG environment variable or just uset it before starting rr. Otherwise, XDEBUG might affect performance.

I use Docker, so no problems with XDebug.