Ho ntlafatsa ts'ebetso ea tlhophiso ea template ea VestaCP phpfcgid liphoso tse ngata tsa 500

VestaCP Kamora hore ts'ebeletso ea WEB e khethe template ea "phpfcgid", palo e kholo ea lits'ebetso tsa PHP-CGI e etsa hore mohopolo o phele kapele:

  • Ke ne ke felloa ke mohopolo ka lihora tse 'maloa ka mor'a ho qala seva bocha.
  • Ts'ebetso ea PHP-CGI ea pele e neng e sa sebetse ha e bolaoe, 'me ts'ebetso e le' ngoe e tsamaisa li-subprocesses tse ka bang 1, e jang bonyane 20M ea mohopolo.

E sebelisoa ho SSH htop taelo (e ea hlokahala), o ka sheba boemo bona ▼

Ka mor'a hore tšebeletso ea WEB ea VestaCP e khethe template ea "phpfcgid", palo e kholo ea mekhoa ea PHP-CGI e etsa hore memori e felloe ka potlako.

Haeba u fumana molaetsa oa phoso "-bash: htop: taelo ha e fumanehe" ha u sebelisa taelo ea htop, ka kopo bona thuto ena bakeng sa tharollo ▼

Palo e kholo ea lits'ebetso tsa PHP-CGI e etsa hore mohopolo o phele kapele. Bothata bo ho VestaCPCentOSHo template ea phpfcgid, ho sebelisoa tlhophiso e sa ntlafatsoang.

  • VestaCP ho template ea phpfcgid, beha ts'ebetso ea 1 PHP-CGI ho tsamaisa lits'ebetso tsa bana tse 20.

Bona /usr/local/vesta/data/templates/web/httpd/phpfcgid.sh Mola oa 13 oa faele:

export PHP_FCGI_CHILDREN=20

Leha ho le joalo, setup se joalo se tlola temoso ea Apache tokomaneng ea tsamaiso ea subprocess ea PHP:

Tsamaiso ea ts'ebetso ea bana ea PHP (PHP_FCGI_CHILDREN) e lokela ho lula e holofetse mod_fcgid, e tla tsamaisa kopo e le 'ngoe feela ka nako ho ea lits'ebetsong tsa kopo eo e e hlahisitseng; ka hona, mekhoa leha e le efe ea bana e entsoeng ke PHP e ke ke ea sebelisoa ka katleho. .) Ka kamehla, le ka maemo a feto-fetohang a tikoloho PHP_FCGI_CHILDREN=0, Tsamaiso ea ts'ebetso ea bana ea PHP e koetsoe.

Hobane mojuleng oa Apache's mod_fcgid, ts'ebetso ea PHP-CGI e ka arabela kopo e le 'ngoe feela mme e sebetsa ka nako e le ngoe, ts'ebetso ea bana ea PHP-CGI ha e sebetse haholo.

Ka hona, litlhophiso tsa tsamaiso ea subprocess ea PHP li lokela ho koaloa ka kotloloho ▼

PHP_FCGI_CHILDREN=0

Ka nako e ts'oanang, haeba u se u ntse u e-na le moamoheli ea hlahisitsoeng, o hloka ho fetola lifaele tsa tlhophiso ea liwebsaete tsohle ▼

/home/用户名/web/域名/cgi-bin/fcgi-starter

Kamora ho bula faele ea tlhophiso ea fcgi-starter, kenya tse latelang ▼

export PHP_FCGI_CHILDREN=20

Fetola ho ▼

export PHP_FCGI_CHILDREN=0
  • Ka mor'a ho fetoloa, tsamaiso ea PHP subprocess e tla tima ka mokhoa oa mod_fcgid.
  • Ts'ebetso ea PHP-CGI ha e sa tla hlola e hlahisa lits'ebetso tsa bana, tse ka bolokang mohopolo o mongata.

Hape, VestaCP ha e behe mokhoa oa ho emisa bakeng sa lits'ebetso tse sa sebetseng:

  • Mekhoa eohle e sa tsoa etsoa ea PHP-CGI e tla tsoelapele ho sebelisa mohopolo ho fihlela sistimi e qala hape.

Ho lokisa sena, kenya feela file ea mod_fcgid config /etc/httpd/conf.d/fcgid.conf Kenya litlhophiso tse latelang ho ▼

FcgidIdleTimeout 120
  • Beha Apache hore e bolaee lits'ebetso tsa PHP-CGI ka bo eona tse sa sebetseng metsotso e 2 (metsotsoana e 120).

Ka mor'a hore ho seta ho phethe, qala hape tšebeletso ea Apache ▼

service httpd restart

Kamora hore ts'ebeletso e qale hape, makholo a lits'ebetso tsa PHP-CGI tse neng li bontšitsoe pele ho HTOP ha li sa tla hlola li hlahisoa.

Ka tloaelo, ts'ebetso e le 'ngoe ea PHP-CGI bakeng sa mosebelisi a le mong oa Vesta CP e sebelisa 30 ho isa ho 40M ea mohopolo, e khotsofatsang ka botlalo.Linuxlitlhoko tsa moamoheli.

ka hona,网络 营销batho ba batla ho etsa hantleSEO, ho bohlokoa haholo ho ntlafatsa tlhophiso ea Vesta CP le litempele ^_ ^

U ka sheba lithupelo tse latelang ho phanele ea VestaCP ▼

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) o ile a arolelana "Optimizing VestaCP phpfcgid Template Configuration Process Multiple Memory Exhaustion 500 Liphoso", e leng thuso ho uena.

Rea u amohela ho arolelana sehokelo sa sengoloa sena:https://www.chenweiliang.com/cwl-735.html

Ho notlolla maqheka a patiloeng🔑, rea u amohela ho kenela mocha oa rona oa Telegraph!

Share le ho rata haeba u e rata! Likabelo tsa hau le tseo u li ratileng ke khothatso ea rona e tsoelang pele!

 

Comments

Aterese ea hau ea lengolo-tsoibila e ke ke ea phatlalatsoa. Ho sebelisoa masimo a hlokahalang * Letšoao

Scroll ho Top