Website path and Website symlinks modifying after the installation

Discussion in 'Installation/Configuration' started by lnxgs, Feb 4, 2016.

  1. lnxgs

    lnxgs Member

    I installed Ispconfig 3. Some websites perform bad because the page composition involves many files (Wordpress with many plug-in enabled).
    I notice that most of syscalls performed by a php-fpm process are lstat:

    0.000055 stat("/var/www/clients/client1/web31/web/wp-includes/default-constants.php", {st_mode=S_IFREG|0644, st_size=9217, ...}) = 0
    0.000029 lstat("/var/www/clients/client1/web31/web/wp-includes/default-constants.php", {st_mode=S_IFREG|0644, st_size=9217, ...}) = 0
    0.000025 lstat("/var/www/clients/client1/web31/web/wp-includes", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
    0.000024 lstat("/var/www/clients/client1/web31/web", {st_mode=S_IFDIR|0711, st_size=4096, ...}) = 0
    0.000023 lstat("/var/www/clients/client1/web31", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    0.000023 lstat("/var/www/clients/client1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    0.000023 lstat("/var/www/clients", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    0.000022 lstat("/var/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    0.000022 lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    0.000022 fcntl(4, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}) = 0
    0.000018 fcntl(4, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=1}) = 0

    For a single file request, I have 8 syscalls to verify the permissions. :(

    So I would like to reduce this overhead, avoiding some "nesting" folders.
    Can I replace /var/www/clients/client1/web31/web/ with something like /www/web31/web/ for existing websites?
    If so, any drawback?

    Last edited: Feb 6, 2016
  2. Jesse Norell

    Jesse Norell Active Member

    The difference in time with the change you proposed is only .000001 seconds. So say you have 1000 files that are being checked, that's a total of .001 seconds. I don't know for certain the answer to your question (ie. can that be changed?), but I suspect it is "no" - however even if it is yes, I don't think saving the time to lstat 3 directory levels less is the performance boost you're needing.
  3. lnxgs

    lnxgs Member

    thank you for your precious suggestion.
    I implemented opcache then I retraced the process and no so much syscalls...
    What I found a little bit stupid that everything is checked many times: if the process opens /var/www/clients/client1/web31/web/index.php after a while /var/www/clients/client1/web31/web/second.php (they both are on the same folder), the entire path is checked twice.
    However, on new servers where I will install Ispconfig 3 from scratch, I will find a shorter path.

  4. Jesse Norell

    Jesse Norell Active Member

    The entire path is checked, which is less efficient, but it's very quick (millions of a second), so I wouldn't worry much about that. The info is cached in memory, you aren't accessing the disk for those repeated checks.

    Have you looked at HHVM? I know almost nothing about it, but do remember this article: - someone working on hhvm with ispconfig setup was posting in the forums here not terribly long ago, so might be something worth a look.
  5. lnxgs

    lnxgs Member

    Hi Jesse,
    I installed PHP 7 with opchache file cache enabled with PHP-FPM and many lstat syscalls disappear. This helps a lot... when you have roughly 90k of lstat for a single home page (WP + many plug-ins), I think it is not so good.

  6. Jesse Norell

    Jesse Norell Active Member

    If you haven't done so, add a caching plugin to your wordpress site and it should help a lot (not on the issues you had when wordpress does fully load, but for pages you have in cache you avoid all of that).

Share This Page