0

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

[root@domain]php /path/to/my/script.php

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?

Edit

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

Ergec
  • 608
  • 1
  • 9
  • 25
  • 1
    What else is different between the two virtual machines? – Michael Hampton Nov 21 '18 at 15:11
  • @MichaelHampton both servers are installations which I followed "howtoforge perfect centos server" guidelines. old one is even live and has 30 to 40 percent load on it. New one is for testing and has no load at all. I am suspecting the old one does some sort of caching for PHP. I'm still trying to isolate the bottleneck. if I find one let you know. – Ergec Nov 21 '18 at 17:12
  • @MichaelHampton I updated my question. Problem seems to be APCu. – Ergec Nov 22 '18 at 06:50
  • 1
    APC/APCU has been a crashy piece of garbage for years. Getting rid of it is a good idea. Though APCu doesn't "cache files" so I don't know what you are expecting from it. – Michael Hampton Nov 22 '18 at 12:12
  • @michaelhampton I didn't know that it doesn't cache files. is it possible that you suggest me an alternative to cache files? – Ergec Nov 22 '18 at 12:58
  • @michaelhampton thanks for heads up about apcu not caching files. I removed it and installed zend opcode cache and now it works. if you write your comments as an answer i'd be more than happy to accept it. – Ergec Nov 23 '18 at 05:37

0 Answers0