I know this question might be too broad but I'm desperate.
Prenote: Here I'm testing php with CLI but same difference occurs with Apache+PHP too. But to avoid Apache caching and other stuff I used only php cli for testing.
I've two dedicated VM servers.
First one is running 4gb memory 32bit Centos 6.8 PHP 5.3.3
Second one is fresh install 8gb memory 64bit Centos 7.5 PHP 5.4.16
I've a test script written in PHP that does some basic operations (nothing related to databases or other services just basic operations like calculations e.t.c)
I also tested these two servers by downloading Codeigniter and run it on both. If you know by default codeigniter welcome page shows how long did it take to generate welcome screen.
Command that I run to test scripts is from SSH client and it simply
Problem is old server always (my script, codeigniter welcome page, on any script) runs 60-70 percent faster than new server.
I even installed second server twice to make sure I haven't messed up but results are same. New server is 60-70 percent slower.
What might be the problem?
Seems the problem is APC. Old server is running APC while new server has APCu. While old server's APC is caching the files, new server's APCu seems to be running but no matter I did in config it does not cache files. I disable APCu in config and
apc.php monitoring panel says APC is not enabled which is the proof config file is ok but when I enable APCu, it seems to be running but never caches the files. APCu config file is default but it doesn't cache. I removed and reinstalled php-pecl-apcu with yum but still not caching. Current version is 4.0.11-1.el7