Das Problem:< /strong>
Das Problem tritt auf, wenn ich versuche, Zeugnisse in großen Mengen zu erstellen oder globale Statistiken für eine ganze Klasse zusammenzustellen.
Im Einzelnen:
Bei der Erstellung von Zeugnissen für Bei einer vollständigen Klasse mit 60 Schülern wird auf der Seite nach etwa 30 Sekunden die Fehlermeldung „Diese Website kann nicht erreicht werden“ angezeigt.

Dieses Problem tritt auch auf, wenn Massenbenachrichtigungen an über 1000 Eltern gesendet werden (z. B. während Nachrichtenankündigungen). Auch beim Registrieren von Massendaten in der Datenbank (über 1000 Benachrichtigungen beim Senden von Nachrichten) treten dieselben Fehler auf, aber in meiner Datenbank werden alle Daten gespeichert, aber die Meldung „Site nicht verfügbar“ wird angezeigt.
Beobachtungen:
- Wenn Massenbenachrichtigungen im Hintergrund mit Symfony Messenger verarbeitet werden, funktioniert der Prozess einwandfrei, selbst bei über 1000 Benachrichtigungen .
- Wenn ich die Zeugniserstellung segmentiere (z. B. 10 Schüler gleichzeitig), wird der Prozess schnell und ohne Fehler abgeschlossen.
- Auf meiner lokalen Entwicklungsumgebung (Windows 10 mit Apache). , 8 GB RAM) werden dieselben Aufgaben unabhängig von der Datengröße erfolgreich ausgeführt. Selbst wenn der Vorgang 1 bis 10 Minuten oder länger dauert, führt er letztendlich zu den erwarteten Ergebnissen.
Ich habe mögliche Lösungen untersucht, einschließlich Vorschläge von ChatGPT und die folgenden Konfigurationen implementiert:
- Debugging mit dem Befehl **free -h ** erstelle ich die Zeugnisse:
- Debuggen mit dem Befehl htop, wenn ich die Berichtskarten erstelle:
- PHP-Limit für php.ini von /etc/php/8.2/fpm/php.ini aktualisieren
- -memory_limit=-1
- maximum_time_execution = 3600
- < strong>post_max_size = 100M
- upload_max_filesize = 100M
- Nginx-Konfiguration auf /etc/nginx/nginx.conf aktualisieren
Code: Select all
user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
# multi_accept on;
}
http {
# Configurations de timeout globales
proxy_read_timeout 300s; # Temps d'attente pour les proxys
fastcgi_read_timeout 300s; # Temps d'attente pour FastCGI
client_max_body_size 100M;
client_body_timeout 300s;
client_header_timeout 300s;
keepalive_timeout 300s;
send_timeout 300s;
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
- hier ist meine MySQL-Konfiguration
Code: Select all
#
# The MySQL database server configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# Here is entries for some specific programs
# The following values assume you have at least 32M RAM
[mysqld]
#
# * Basic Settings
#
user = mysql
# pid-file = /var/run/mysqld/mysqld.pid
# socket = /var/run/mysqld/mysqld.sock
# port = 3306
# datadir = /var/lib/mysql
# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
#
# * Fine Tuning
#
#
innodb_buffer_pool_size = 6G
#innodb_log_file_size = 512M
innodb_redo_log_capacity = 1G
innodb_flush_log_at_trx_commit = 2
innodb_io_capacity = 1000
# Memory and performance tuning
key_buffer_size = 64M
max_allowed_packet = 128M
thread_stack = 256K
thread_cache_size = 8
# Table cache
table_open_cache = 2000
# Connections
max_connections = 500
#wait_timeout = 3600
#innodb_lock_wait_timeout = 3600
# Temp tables
tmp_table_size = 64M
max_heap_table_size = 64M
# Temp tables
tmp_table_size = 64M
max_heap_table_size = 64M
# MyISAM recover options
myisam-recover-options = BACKUP
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
#
# Log all queries
# Be aware that this log type is a performance killer.
# general_log_file = /var/log/mysql/query.log
# general_log = 1
# Error log - should be very few entries.
log_error = /var/log/mysql/error.log
# Here you can see queries with especially long duration
# slow_query_log = 1
# slow_query_log_file = /var/log/mysql/mysql-slow.log
# long_query_time = 2
# log-queries-not-using-indexes
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
# server-id = 1
# binlog_expire_logs_seconds = 2592000
max_binlog_size = 100M
# binlog_do_db = include_database_name
# binlog_ignore_db = include_database_name
- Ich habe dies auch mit meinen PHP-FPM-Wokers auf /etc/php/8.2/fpm/pool.d versucht /www.conf
Code: Select all
pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
- sudo cat /var/log/nginx/error .log
- sudo grep „500“ /var/log/nginx/access.log
[img]https://i.sstatic.net /65ZWJpHB.png[/img]