1

Bir n1-highcpu-16 (16 vCPUs, 14.4 GB bellek) sahibiyim. Ben bir Bitnami NGINX kurulumu ile var.Google Cloud üzerinde 502 hatalı ağ geçidi almak

Sitede yaklaşık 400-600 kişi olduğunda bazen 502 hatalı ağ geçidi veriyor. Ben onunla botlar yapıyorum, bu yüzden benim için büyük hatalar yapma eğilimindedir. Site, bir SQL bağlantısı yapan PHP dosyasına yaklaşık 50-100 istek geldiğinde gerçekleşir. Bundan sonra, sitemde 502 hatalı bir ağ geçidi hatası görünüyor.

Bunu düzeltmek için herhangi bir çözüm var mı?

My PHP ayarları:

pm=static 

; The number of child processes to be created when pm is set to 'static' and the 
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 
; This value sets the limit on the number of simultaneous requests that will be 
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 
; CGI. The below defaults are based on a server without much resources. Don't 
; forget to tweak pm.* to fit your needs. 
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 
; Note: This value is mandatory. 
pm.max_children=50 

; The number of child processes created on startup. 
; Note: Used only when pm is set to 'dynamic' 
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers)/2 
pm.start_servers=5 

; The desired minimum number of idle server processes. 
; Note: Used only when pm is set to 'dynamic' 
; Note: Mandatory when pm is set to 'dynamic' 
pm.min_spare_servers=5 

; The desired maximum number of idle server processes. 
; Note: Used only when pm is set to 'dynamic' 
; Note: Mandatory when pm is set to 'dynamic' 
pm.max_spare_servers=30 

; The number of seconds after which an idle process will be killed. 
; Note: Used only when pm is set to 'ondemand' 
; Default Value: 10s 
;pm.process_idle_timeout = 10s; 
; The number of requests each child process should execute before respawning. 
; This can be useful to work around memory leaks in 3rd party libraries. For 
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 
; Default Value: 0 
pm.max_requests = 5000 
+0

502 gibi bir HTTP hatası, "uygulama günlüklerinizi kontrol etme" gibi bir şey yapmanızı söyleyen bir belirtidir. Bir 502, özellikle bir upstream sunucusuna bağlantıda bir sorun olduğu anlamına gelir ve tüm talep trafiğinizin üstesinden gelmek için tek bir SQL bağlantısı kullandığınızdan bahsetmiş olursunuz, tahminimce bununla bir ilgisi olacaktır. – Adam

+0

Bunun bir ay önce yayınlandığını fark ettim, bugün değil, bu yüzden bu soruna bir çözüm bulursanız lütfen bize bildirin. – Adam

cevap

0

bu SQL bağlantısı ile ilgili bir sorun olduğundan emin misiniz? pm.max_children öğesinin 50 olarak ayarlandığından, 50 iş parçacığının tümü kullanılıyorsa, 502 Bozuk Ağ Geçidi hatası atılır. Daha fazla istekle ilgilenmek için ek sunucular açmayı denemelisiniz. Alternatif olarak, pm.max_children'u yükseltmeyi ve indirmeyi deneyin ve bunun sayıları etkileyip etkilemediğini görün ve bir sonuç çıkarmaya yardımcı olun.