Apache吃空内存,频繁宕机

公司有台比较老的服务器,Apache/2.0.59 (Unix) PHP/5.1.2

在部署一套内网测试环境时,频繁宕机,开机后不断的吃内存,重启apache之后内存占用会不停的上涨,直到swap用完,直到死机,由于是内网环境,服务器并发和压力都很小。

查看apache错误日志,报大量类似错误:

[Tue Feb 14 14:49:28 2012] [warn] child process 7751 still did not exit, sending a SIGTERM

[Tue Feb 14 14:49:30 2012] [error] child process 7603 still did not exit, sending a SIGKILL

[Tue Feb 14 14:49:30 2012] [error] child process 7614 still did not exit, sending a SIGKILL

后查出来是因为php某一些脚本存在内存泄露的代码段。而apache处理这些代码段的进程的处理请求数被设置为无穷。也就是说这些进程只有在apache重启(stop-start模式)或者服务器重启的情况下才会被kill,否则将一直运行下去,直到耗尽系统的最后一点资源(主要是内存)。

问题分析:

//服务器允许配置的进程数上限

ServerLimit 1500

//设置服务器启动时建立的子进程数量。因为子进程数量动态的取决于负载的轻重,所有一般没有必要调整这个参数。

StartServers     5

//MinSpareServers:设置空闲子进程的最小数量。所谓空闲子进程是指没有正在处理请求的子进程。如果当前空闲子进程数少于MinSpareServers,那么Apache将以最大每秒一个的速度产生新的子进程。

MinSpareServers   5

//设置空闲子进程的最大数量。如果当前有超过MaxSpareServers数量的空闲子进程,那么父进程将杀死多余的子进程。

MaxSpareServers   10

//用于客户端请求的最大接入请求数量(最大线程数)。

MaxClients 1500

//设置每个子进程在其生存期内允许提供的最大请求数量

MaxRequestsPerChild 50

问题解决:

设置 MaxRequestsPerChild 50或30

MaxRequestsPerChild不能太大,也不能设置为0,最好设置为一个相对不大的数字,100内可能就够了,防止httpd进程有意外的内存泄露。

最新评论:

no.117332 a.nto.n.zu.e.ev34 176.101.119.72 2020-06-02 12:04

I loved as much as you will receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get bought an shakiness over that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike. mahat.aresgrb.se/useful-tips/hemma-hos-ernst-kirchsteiger.php hemma hos ernst kirchsteiger

no.117330 a.n.to.n.z.ueev.34. 109.254.6.55 2020-06-01 23:44

Truly no matter if someone doesn't understand then its up to other people that they will help, so here it occurs. tastyandinteresting.be/useful-tips/lchf-hur-mycket-fett-ska-man-aeta.php kycklingsГҐs till pasta

no.117329 an.tonz.u.ee.v34. 176.101.119.72 2020-06-01 05:04

Hello I am so glad I found your web site, I really found you by accident, while I was searching on Aol for something else, Anyhow I am here now and would just like to say cheers for a fantastic post and a all round enjoyable blog (I also love the theme/design), I don’t have time to browse it all at the minute but I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the great jo. baghp.aresgrb.se/decorations/handen-centrum-buti

no.117327 a.n.to.n.z.u.ee.v.34 109.254.6.55 2020-05-31 14:20

Hi there would you mind letting me know which web host you're utilizing? I've loaded your blog in 3 completely different browsers and I must say this blog loads a lot faster then most. Can you recommend a good hosting provider at a honest price? Many thanks, I appreciate it! tastyandinteresting.be/relaxation/peut-on-masser-une-femme-enceinte.php technicolor 799vac telia

no.117326 homeencoutbp 5.172.199.73 2020-05-31 10:03

формирование идеальной среды обитания для тех, кто выжил после ядерного апокалипсиса. Развивай сообщество, следи за благосостоянием бункера и каждого жителя в частности. Собирай полезные предметы на поверхности и обеспечивай защиту жителям. [url=https://mirandroidigr.ru/rusty-lake-paradise] rusty lake paradise [/url] [url=https://mirandroidigr.ru/fun-race-3d] fun race 3d [/url] [url=https://mirandroidigr.ru/wechat] wechat [/url]

no.117325 no-reply 2.95.183.162 2020-05-31 02:28

Наша компания занимается расскруткой продвижение сайта буржунет совершенно не дорого. В случае, если у вас существует свой бизнес, тогда рано или поздно вы лично осознаете, что без оптимизация и продвижение сайтов сшау вас нет возможности работать дальше. Сейчас фирма, которая подумывают о собственном будущем развитии, должна иметь веб-сайт для seo продвижение сайтов google. продвижение англоязычного сайта в google- способ, используя который возможно приобретать новых покупателей, и дополнитель

no.117324 an.to.n.z.u.eev.3.4. 176.101.119.72 2020-05-31 00:14

Hi! I simply would like to offer you a huge thumbs up for your excellent information you have here on this post. I am coming back to your website for more soon. ylbam.aresgrb.se/decorations/symptom-foer-graviditet.php symptom for graviditet

no.117321 catch389vhj 80.82.64.229 2020-05-30 14:04

Why orthodox christians celebrate christmas in january? If they don't do that, who do they celebrate christmas for? Do you not celebrate christmas for yourself or do you celebrate it in honour of christmas? (Yes, all these holidays are celebrated for christmas, what does it matter which day you celebrate? What is important is that everyone is able to celebrate, no matter where they're at, especially if they're from somewhere other than christmas countries, in the UK for instance. The reason I do

no.117320 valeriyamny 89.248.174.24 2020-05-30 14:04

Fraser is ferry changes delayed. Widow-in-waiting, Peter Pan, and another new theme from the show, "A Boy And His Dog," are already underway in downtown Halifax. Marilyn Moore A few moments earlier, a few rows behind her in the back of the auditorium at the Sheraton Galleria hotel, Marilyn Moore was working. After years of looking forward to this time of year, the 50-year-old from Calgary had been waiting to see if the show's premiere would be a real surprise, as expected. Instead, at 11:30

no.117318 anton.zue.e.v34. 109.254.6.55 2020-05-30 08:03

Hey! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a wonderful job! tastyandinteresting.be/beautiful-things/pablo-picasso-kunstwerken.php bultmönster vw passat

no.117316 yes 46.0.203.99 2020-05-29 16:53

[b]Good bedroom furniture los angeles - [url=https://www.furnitopia.com]round dining table[/url][/b] Our online store international company provides discount, write in an online chat.At the present time you are in best Our оnline store specialized firms in Bel air products for garden and home use and office modern lighting stores los angeles. Firm sells over 5000 products for a country house and houses or cafe-bar and piece of furniture.Natural tree, the that are used for the purpose products,

no.117314 a.n.t.onzue.e.v.3.4 109.254.6.55 2020-05-29 04:43

Hi to every one, it's genuinely a good for me to go to see this web site, it consists of priceless Information. tastyandinteresting.be/beautiful-things/elizabeth-arden-eye.php balklänningar för stora kvinnor

no.117310 an.to.nzu.ee.v34. 109.254.64.113 2020-05-28 09:48

Hi, I desire to subscribe for this website to take most up-to-date updates, so where can i do it please help. froml.aresgrb.se/decorations/phlebitis-treatment-at-home.php phlebitis treatment at home

no.117304 a.nt.o.n.z.ue.ev.34 109.254.6.55 2020-05-28 01:06

Your means of explaining the whole thing in this article is actually good, every one can without difficulty know it, Thanks a lot. tastyandinteresting.be/beautiful-things/voir-photo-de-bouton-de-gale.php kost för att minska bukfett

no.117292 catch129c4b 89.248.174.39 2020-05-27 12:19

Indigenous woman jailed over unpaid fines after police call for help to raise $16.2M to pay to build her daughter's house Updated A young Aboriginal woman from the Southern Territory has spent $16 million (US$16.2 million) of her own money on a tiny house. Ms Hui, 21, from the Kalinah, Northern Territory, spent $4.85 million on a house in Alice Springs where she spent four months living out of her bedroom. She has not been seen in public since last month. "I just want to be left alone with

no.117288 anton.z.u.ee.v3.4. 109.254.64.113 2020-05-27 09:20

Hey there! I know this is kinda off topic however , I'd figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My blog discusses a lot of the same topics as yours and I feel we could greatly benefit from each other. If you happen to be interested feel free to shoot me an email. I look forward to hearing from you! Wonderful blog by the way! gueve.aresgrb.se/useful-tips/tips-tegen-pukkels.php tips tegen pukkels

no.117277 manicesh 81.177.174.59 2020-05-27 00:19

Два ёмких тоста: Поехали как-то два соседа на базар вино продавать. По пути они сели передохнуть и закусить. - Хорошо бы сейчас по стаканчику винца выпить, - вздохнул один. - Хорошо-то хорошо, но вино мы везем продавать и нельзя тратить даром ни капли! - рассудил второй. Тогда первый обшарил карманы, нашел медный пятак и говорит соседу: - Налей-ка мне винца на пятачок. Налил ему сосед один стакан, потом вернул тот же пятак и попросил: - А теперь ты мне налей. Так ходил этот пятак из

no.117276 anton.zueev.34 109.254.6.55 2020-05-26 23:24

Good day! I could have sworn I've been to this site before but after going through some of the posts I realized it's new to me. Regardless, I'm certainly pleased I came across it and I'll be book-marking it and checking back regularly! tastyandinteresting.be/decorations/douleur-doigt-de-pied.php denim blouse zonder mouwen

no.117265 an.ton.z.u.e.e.v3.4 109.254.6.55 2020-05-26 12:45

I absolutely love your website.. Great colors & theme. Did you create this web site yourself? Please reply back as I'm trying to create my very own site and would love to find out where you got this from or what the theme is named. Many thanks!

no.117263 fsdffqqwr 185.206.224.211 2020-05-26 11:42

Спасибо за пост _________________ [url=https://pinup.topgamesmoneyru.xyz]pin up казино 80[/url]

no.117261 f4tlsh 128.71.223.15 2020-05-26 10:26

[b][url=https://labedroom.com/]Furniture for sale[/url][/b] Come in outstanding store in Jefferson Park production for office and home use and cafe! presents over 12000 appointment furniture and goods for a country house and apartments or restaurant. Natural rattan , are used for the purposes of production our branded products , possesses strength and wear resistance, wonderful external data. All furniture processed special compounds, due to which their surface does no

no.117260 atsu1013 5.188.210.18 2020-05-26 07:22

[url=https://happyend24.ru]имитация грудью в королёве[/url] или [url=https://happyend24.ru]массаж в г королёве эротический[/url] https://happyend24.ru

no.117251 an.tonz.u.ee.v.34 109.254.64.113 2020-05-25 19:22

hey there and thank you for your info – I have definitely picked up something new from right here. I did however expertise a few technical issues using this site, as I experienced to reload the web site many times previous to I could get it to load correctly. I had been wondering if your web hosting is OK? Not that I'm complaining, but slow loading instances times will sometimes affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords. We

no.117250 catch270b4 80.82.64.229 2020-05-25 18:34

Surprise engagement for maatsuyker island caretakers After some discussion, they agreed on an agreement with the state for a special "Maatsuyker Day," scheduled for Saturday (Oct. 28). The state will also donate the funds to Maatsuyker Island caretakers for the Maatsuyker Day celebration. Maatsuyker caretakers will also be able to volunteer at other events in the area, from holding demonstrations to taking part in other activities. "The agreement we have reached with the state is for two days,

no.117249 an.t.o.n.zuee.v3.4 109.254.6.55 2020-05-25 18:26

Hey! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no data backup. Do you have any solutions to protect against hackers?

no.117248 valeriyamny 89.248.174.24 2020-05-25 18:03

Us official highlights guantanamo torture in 'The Guantanamo Files' The Pentagon also provided details about interrogation methods to a judge investigating the Guantanamo Bay detention facilities. The Pentagon has said it did not provide the full details. The official was not authorized to discuss the investigation and spoke on condition of anonymity. Some of the documents appear to contradict White House assertions in recent days, saying the administration has rejected pleas from six Democra

no.117246 a.nt.on.zu.e.ev.3.4 185.29.255.19 2020-05-25 16:26

I used to be able to find good info from your content. chetpo.goodprizwomen.com/delicious-dishes/canon-ix6850-blaeck.php canon ix6850 black

no.117240 mb692852 185.166.87.200 2020-05-25 10:25

Официальный сайт Hydra предлагает купить запрещенные товары, сохраняя при этом полную анонимность. Среди запрещенных товаров на сайте https://hydraruzxinew4afsite.com/ имеются различные наркотические вещества: опиаты, психоделики, экстази, марихуана, стимуляторы. Если сайт по каким-либо причинам не открывается, используйте VPN или ссылку на Гидра зеркало. [url=https://hydraruzxinew4afsite.com/]гидра Вики [/url]

no.117239 cbdsf 178.159.37.69 2020-05-25 08:06

where can i buy herbal viagra over the counter <a href="https://judpharmacy.com/">viagra buy singapore</a> buy cheapest generic viagra online

no.117233 dsgdkghki45 120.132.52.127 2020-05-25 01:44

Thesis writer in philippines only. [url=https://2dx3.writingservice.education/en/purchasing-thesis-30818.html]https://2dx3.writingservice.education/en/purchasing-thesis-30818.html[/url] Online research paper writing services. [url=https://m1.writingservice.education/en/chemistry-coursework-the-79195.html]https://m1.writingservice.education/en/chemistry-coursework-the-79195.html[/url] Auburn dissertation search. [url=https://n9.writingservice.education/en/beetroot-coursework-analysis-90142.html]h

no.117232 an.to.nzue.e.v34 109.254.6.55 2020-05-25 00:18

Howdy would you mind stating which blog platform you're using? I'm going to start my own blog in the near future but I'm having a hard time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I'm looking for something completely unique. P.S My apologies for getting off-topic but I had to ask!

no.117230 catch32yn0 89.248.174.39 2020-05-25 00:12

Crocs must sink pirates!" "No! I'll never sink them!" He's right. Not only is it the perfect example of a troll saying exactly that, it's also an incredibly common troll tactic. You've certainly heard it. Trolls aren't afraid of pirates. They know you'll be there. A troll can tell. If you're a pirate then they're probably going to try and beat you to it, no matter what you say. But you know that if you're a troll you're never going to let that happen to you. "Don't fight me if I win!" That'

no.117227 an.ton.z.ueev3.4. 185.29.255.19 2020-05-24 23:26

It's truly very difficult in this active life to listen news on Television, thus I only use world wide web for that purpose, and take the hottest information. tungce.goodprizwomen.com/music/kvaellen-gr-omkring-och-plockar-faerger.php kvallen gar omkring och plockar farger

no.117218 sam 2.95.171.56 2020-05-24 16:21

[b][url=https://3aplus63.ru/lebedka/]ручная лебедка для подъема[/url][/b] Созданная нами предприятие Новочеркасск - сегодня это ведущий поставщик промышленного оборудования. Можно купить в Каменск-Уральскийнемало решений для такелажного и подъемного, промышленного и складского, а также весового и гидравлического промышленного оборудования, в том числе тали ручные рычажные,тали ручные червячные передвижные взрывобезопасные,домкраты гидравлические телескопические,канаты для лебедок mtm,ба

no.117212 a.n.t.onzu.eev.34. 185.29.255.19 2020-05-24 10:14

Very good info. Lucky me I came across your blog by chance (stumbleupon). I've book marked it for later! tupug.goodprizwomen.com/beauty/byta-ut-florsocker-mot-stroesocker.php byta ut florsocker mot strosocker

no.117204 a.n.t.o.n.zu.ee.v34. 109.254.6.55 2020-05-24 05:08

Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say superb blog!

no.117190 annhoff679 5.188.84.150 2020-05-23 17:27

— РЇ думал, что РјРѕРіСѓ называть РёС…, как захочу. [url=https://meinbilligkredit.top/vziat_kredit_onlain_na_kartu_pod_0_protsentov.php]взять кредит онлайн РЅР° карту РїРѕРґ 0 процентов[/url], [url=https://meinbilligkredit.top/banka_kredit_dnepr.php]банка кредит днепр[/url]. Завтра нас собираются уничтожить. [url=https://meinbilligkredit.top/plokhoi_kredit_moskva.php]плохой кредит Р

no.117189 antonzu.ee.v3.4 185.29.255.19 2020-05-23 15:23

This is very interesting, You're a very skilled blogger. I've joined your feed and look forward to seeking more of your magnificent post. Also, I've shared your website in my social networks! kepa.goodprizwomen.com/music/eiwitten-in-vlees.php eiwitten in vlees

no.117188 zgsfknhxa 91.222.236.99 2020-05-23 15:20

effetti collaterali del cialis 20 mg https://cialisk.com/# buy generic cialis <a href=https://cialisk.com/>cheap cialis online</a> which is better tadalafil or sildenafil

no.117187 ant.o.nzuee.v3.4 109.254.64.113 2020-05-23 10:48

I like the valuable information you provide in your articles. I'll bookmark your weblog and check again here frequently. I'm quite sure I'll learn lots of new stuff right here! Best of luck for the next! ispa.aresgrb.se/beauty/veterinaerfoder-till-katt.php veterinarfoder till katt

no.117184 catchk67z 93.174.93.24 2020-05-23 00:44

[url=https://www.onikssport.com/]우리카지노[/url] [url=https://www.grupo-huk.com/]우리카지노[/url] Try out, upright a investigation Evaluation, just a test

no.117182 anto.n.zu.e.ev.3.4 185.29.255.19 2020-05-22 20:28

After I originally left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with the exact same comment. Is there an easy method you are able to remove me from that service? Appreciate it! tupug.goodprizwomen.com/skin-care/plastfilm-frostat-glas.php plastfilm frostat glas

no.117181 valeriyamny 89.248.174.24 2020-05-22 17:28

바카라사이트[url=https://www.shamsbim.com/]바카라사이트[/url]

no.117180 anton.z.ue.e.v3.4 185.29.255.19 2020-05-22 12:18

Hmm is anyone else encountering problems with the pictures on this blog loading? I'm trying to figure out if its a problem on my end or if it's the blog. Any feed-back would be greatly appreciated. chaoos.uradwoun.co/news/klipp-dig-sjaelv.php klipp dig sjalv

no.117177 alon552 5.188.210.18 2020-05-22 04:29

[url=https://extraint.ru/catalog/bra_devonshire_k-105071]Столовая Современная[/url] или [url=https://extraint.ru/catalog/zerkalo_specchio]Стол сервировочный Flat Flix[/url] https://extraint.ru/brand/mebel1/page/2/

no.117175 chad2209r 5.188.210.18 2020-05-21 23:59

Посмотреть [url=https://moscowakb.ru/shop/page2/]АКБ nissan теранно 1.6 2013[/url] или [url=https://moscowakb.ru/shop/akkumulyatory-dlya-legkovykh-avtomobiley/avtomobilnye-akkumulyatory-gm/]Аккумулятор Мерседес GL X166 550 2010[/url] Аккумулятор для Инфинити FX37 2014 https://moscowakb.ru/shop/akkumulyatory-dlya-legkovykh-avtomobiley/avtomobilnye-akkumulyatory-ford/

no.117174 a.n.t.o.n.zu.ee.v.34. 185.29.255.19 2020-05-21 22:12

I got this website from my pal who shared with me regarding this website and now this time I am browsing this web page and reading very informative posts at this place. runi.uradwoun.co/delicious-dishes/rabarberpaj-utan-smoer.php rabarberpaj utan smor

no.117170 an.t.onz.uee.v3.4. 185.29.255.19 2020-05-21 10:27

Remarkable things here. I'm very satisfied to look your post. Thank you so much and I am looking forward to touch you. Will you please drop me a e-mail? spa.uradwoun.co/skin-care/balance-my-skin-lcc.php balance my skin lcc

no.117162 an.tonz.u.ee.v.34. 185.29.255.19 2020-05-19 22:58

I every time spent my half an hour to read this website's articles every day along with a mug of coffee. disla.uradwoun.co/skin-care/normalvikt-foer-laengd.php normalvikt for langd

no.117158 a.nt.on.z.u.e.ev3.4 185.29.255.19 2020-05-19 15:55

Pretty nice post. I simply stumbled upon your weblog and wanted to mention that I've truly loved browsing your weblog posts. After all I will be subscribing to your feed and I hope you write again very soon! glycim.uradwoun.co/news/peppar-till-pepparkvarn.php peppar till pepparkvarn

发表评论:

邮箱: