0

a customer asked to migrate their current server with plesk to a HA infrastructure. I've created the structure with haproxy and apache 2.4, but i can see many requests take a looooong time (some of those take about 3 mins).

I tried to bypass haproxy and point postman directly to the apache server and the problem is on apache. Same if i try curl from localhost.

On the new server there isn't any traffic currently.

The same URL is served in milliseconds from the old plesk webserver. Hardware configs are the same on old and new servers, In addition i can see CPU and memory on new server are very low (1% CPU and 0.26Gb memory used) during the request.

I googled a lot and tried many changes but nothing solved my problem and i'm going crazy to understand why it happen.

Server config: 2x vCPU 8 Gb memory 80Gb Disk space OS: Ubuntu 20.04 Apache 2.4.41-4ubuntu3.12 PHP 7.4.3-4ubuntu2.12 (did some test also with PHP-FPM but nothing changed)

This is the last vhost config i tried:

    <VirtualHost xx.xx.xx.xx:80 >
        ServerName "api.xxxxxxxx.xxx"
        UseCanonicalName Off

        DocumentRoot "/var/www/vhosts/api.xxxxxxxx.xxx/api"
        CustomLog /var/www/vhosts/api.xxxxxxxx.xxx/logs/access_log combined
        ErrorLog "/var/www/vhosts/api.xxxxxxxx.xxx/logs/error_log"

        <Directory /var/www/vhosts/api.xxxxxxxx.xxx/api>
                <IfModule mod_fcgid.c>
                        <Files ~ (\.fcgi$)>
                                SetHandler fcgid-script
                                Options +ExecCGI
                        </Files>
                </IfModule>

                Options -Includes -ExecCGI
        </Directory>

        <Directory /var/www/vhosts/api.xxxxxxxx.xxx>
                Options +FollowSymLinks
        </Directory>

        DirectoryIndex "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml"

        <Directory /var/www/vhosts/api.xxxxxxxx.xxx>
                AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,SymLinksIfOwnerMatch,MultiViews,FollowSymLinks,ExecCGI,Includes,IncludesNOEXEC
        </Directory>
</VirtualHost>

Then, What the f*** i'm doing wrong?

Nando
  • 1
  • There is a high possibility that this is related to DNS. Try setting `UseCanonicalName On` and make sure `api.xxxxxxxx.xxx` mentioned in the `ServerName` is pointing to the server itself (maybe using `/etc/hosts`) – ttsakpc Aug 10 '22 at 12:20
  • Thank a lot ttsakpc. I've tried to change UseCanonicalName to On and checked again /etc/hosts but nothing changed.... :( – Nando Aug 10 '22 at 13:58

0 Answers0