Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nova is really slow - how could I split the nginx config #450

Open
lagerroos opened this issue Nov 23, 2020 · 4 comments
Open

Nova is really slow - how could I split the nginx config #450

lagerroos opened this issue Nov 23, 2020 · 4 comments
Labels

Comments

@lagerroos
Copy link

Please provide your PHP and Swoole version.

PHP 7.4.11, Swoole 4.5.4

Please provide your Laravel/Lumen version.

8.11.2

Which release version of this package are you using?

2.6.68

What did you do? If possible, provide a recipe for reproducing the error.

I'm trying to get Laravel Nova to work under Laravel Swoole. It's really slow so I'm trying to figure out a Nginx conf that could be used to load nova through php-fpm.

What did you expect to see?
Nova working quickly and properly.

What did you see instead?
Nova works quickly for approx 2 minutes then slows down itself and the other parts of the system aswell.

Here is my NGINX-config.

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_name domain.com;
root /var/www/html/domain-staging/public/;
index index.php;
location = /index.php {
# Ensure that there is no such file named "not_exists"
# in your "public" directory.
try_files /not_exists @swoole;
}
location / {
try_files $uri $uri/ @swoole;
}
location /nova/ {
try_files $uri $uri/ /index.php?$query_string;
#try_files $uri $uri/ =404; #@swoole;
location ~ .php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix ?$query_string;
}
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# IF https
proxy_set_header HTTPS "on";
proxy_pass http://127.0.0.1:1216$suffix;
}
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/json
application/xml
application/rss+xml
image/svg+xml;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name domain.com;
listen 80;
return 404; # managed by Certbot
}
server {
if ($host = www.domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name domain.com www.domain.com;
return 404; # managed by Certbot
}

@Arkanius
Copy link
Member

@lagerroos
Copy link
Author

Hey! Just saw this. This is not relevant as I need to split nova out to a subdirectory loaded by PHP FPM instead of Swoole.

@fibis
Copy link

fibis commented Dec 8, 2020

Had the same problem, after some time, Nova is getting really slow with swoole. We deliver Nova now with a php-fpm container. Sad story.

@amshee-zameen
Copy link

@lagerroos Were you able to solve that issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants