Is CakePHP 3.3 slower than 3.2 (~50ms)?


#1

Hi, last week we updated our Cake application to 3.3 and noticed, that our response times with 3.3 are on average ~50ms slower than they used to be with 3.2.

50ms isn’t much and I think that it might have been caused by the new middleware. Nevertheless I wanted to check it with you.

Have anyone experienced similar behavior? Or is it totally unexpected and we should look into it?

Thank you.

Here is a NewRelic screenshot that illustrates the change. Clever observers will notice that the deploy happened around 10:00 AM :slight_smile:


#2

I’m not aware of a big difference in my own projects, but I’m very interested in knowing the source of the slowdown. Since you are using NewRelic, would you mind sharing some of the profiling information and help us know which part of the framework got slower?


#3

Is there a chance that you have both middleware and dispatch filters attached? I could see that adding 50ms of response time. Is there any way you could get more resolution from newrelic using the agent API to see what the internal time breakdown is?


#4

We have both middleware and dispatch filters, but each “filter” is added only once. ErrorHandler, Asset and Routing are attached using middleware, 4 custom ones are attached using dispatch filters. That should be OK, right? I might however try rewriting the custom ones to use middleware.

I’m not aware of any way how to make NewRelic output more details, I’ll have a look into their docs. Not sure though if we will be able to afford to turn it on in production :wink:

I can also try xdebug profiler on my machine, maybe it’ll be visible there.


#5

Having both middleware and dispatch filters is perfectly fine. I was concerned that there were duplicates, but it doesn’t sound like that’s the case.

Keep us posted on what you find :smile:


#6

Hello again :slight_smile:

So I looked at a sample request with xdebug profiler in both 3.2 and 3.3 and the time spent in the framework was basically the same.

Today I updated the app to 3.3.14 and same thing happened on the server. So now we’re wondering whether it can be related to OPcache or something. When updating the dependencies, we swtich the whole vendor folder, so all the 3rd party code is “new”.

When I looked back at the January data (when we first noticed it), the ~50ms delay disappeared (abruptly) after a day or so (more like 18 hours).

So I guess you are safe guys :slight_smile:
Sorry for bothering you, thanks for the opinions.