Discover Centmin Mod today
Register Now

Nginx PHP-FPM Not Sure why but i Get Poor Performance

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by RootPass, Mar 8, 2018.

  1. RootPass

    RootPass New Member

    26
    3
    3
    Mar 22, 2017
    Ratings:
    +4
    Local Time:
    2:37 AM
    CentMin
    CentMin
    hey guys,
    i'm using Centmindmod stable running on a Ramnode 3$ KVM 512MB

    I have a Php / Mysqli script with alot of sql and php commands that im running and I get
    slower result on centmin setup than on a shared hosting.

    Any ideas how to tweak it?
    Thanks

     
    Last edited: Mar 8, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    50,905
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,256
    Local Time:
    10:37 AM
    Nginx 1.25.x
    MariaDB 10.x
    Slower in what exactly .. can you elaborate with specific measured examples of performance you are testing for ? If it's pure php and mysql command line in SSH then pure cpu clock speed may factor into speed of php processing and speed of disks and memory bandwidth speed (mysql buffers) as to speed of mysql data processing and retrieval.

    FYI, Centmin Mod 123.09beta01 is also faster and more optimised than 123.08stable branch too. But the type and specs of VPS also matter, you can have a slow VPS vs faster shared hosting server as well. Also if you tasks require more than 512MB memory, shared hosting might allow you to burst beyond 512MB memory too or have faster memory bandwidth.

    FYI #2, ramnode std KVM is on slower cpus than ramnode premium KVM which are on faster clocked cpus RamNode | SSD VPS Plans - Virtual Private Servers

    Another factor is whether or not servers have Kernel security updates for Meltdown/Spectre vulnerabilities which reduce performance for some workloads between 5-40%. Your own KVM VPS with latest YUM updates may have those Kernel security updates. But your shared hosting server may or maynot have those updates so the performance gap could widen.

    The gist of it is that there's Kernel security updates have a side effect of reducing performance for some work loads which have alot of system calls/context switches etc. Details and discussions are available at Intel Processor Flaw 'kernel memory leaking' [Spectre & Meltdown]. You should subscribe/watch the thread for further news and developments as the situation is still fluid and on going with Linux distributions and upstream Kernel updates for Spectre and Meltdown as well as work on improving performance post Kernel KPTI patching.

    For instance normal distribution supplied Nginx web servers might have up to 26% performance reduction after Kernel KPTI security updates. Centmin Mod Nginx luckily isn't a normal Nginx server build and uses alternate Jemalloc memory allocator instead of system Glibc malloc so the performance reduction was measured around 5.5%.

    If using MyISAM tables in MySQL, you would want to look at converting them to InnoDB if possible as the Kernel KPTI performance impact and reduction can be as high as 40% according to MariaDB benchmarks. Centmin Mod MariaDB MySQL users however will be glad to know that if using MariaDB 10.0 or 10.1 branch, their performance impact will be much less due to MariaDB 10.0/10.1 not using system Glibc malloc memory allocator but using Jemalloc (like Centmin Mod Nginx does), so the performance reduction may not be as severe. MariaDB tested tcmalloc alternate memory allocator and the performance reduction impact dropped from 27+ % to under 2.7% (details).

    So more more info on shared hosting server hardware specs, operating system version, kernel version and php and mysql versions would help.
     
    Last edited: Mar 8, 2018
  3. eva2000

    eva2000 Administrator Staff Member

    50,905
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,256
    Local Time:
    10:37 AM
    Nginx 1.25.x
    MariaDB 10.x
  4. eva2000

    eva2000 Administrator Staff Member

    50,905
    11,799
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,256
    Local Time:
    10:37 AM
    Nginx 1.25.x
    MariaDB 10.x
    Also Ramnode 512MB KVM doesn't have the minimum disk size requirements outlined on official Centmin Mod install page Centmin Mod LEMP Stack Install Nginx on CentOS
    • recommended for CentOS 7 on KVM VPS is 2GB memory and 60GB disk
    • minimum recommended for CentOS 7 on KVM VPS is 1GB memory and 30GB disk
    • recommended for CentOS 6 on KVM VPS is 512MB memory and 60GB disk
    • minimum recommended for CentOS 6 on KVM VPS is 256MB memory and 30GB disk

    FYI, CentOS 7 is faster than CentOS 6 too