Optimizing Apache Memory Usage | Mpm prefork settings

  Рет қаралды 17,948

Chris Titus Tech

Chris Titus Tech

5 жыл бұрын

This video goes over optimizing apache memory usage by configuring mpm prefork module to optimal values for your server.
UPDATE: Run this curl command and it will just tell you what you should put
curl -sL raw.githubusercontent.com/ric... | perl
Commands used:
Check Apache Memory usage
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
Launch Memory manager / resource viewer
'htop' OR you can use 'top' for less options and visuals
Values to calculate:
Total System Memory Free - Buffer / Apache2 MB usage = MaxRequestWorkers, ServerLimit, and MaxClients
My Settings in Video: Server Instance (Standard) 1 dedicated vCPU with 3.5 GB of Memory
prefork MPM
StartServers: number of server processes to start
MinSpareServers: minimum number of server processes which are kept spare
MaxSpareServers: maximum number of server processes which are kept spare
MaxRequestWorkers: maximum number of server processes allowed to start
MaxConnectionsPerChild: maximum number of requests a server process serves
StartServers 3
MinSpareServers 5
MaxSpareServers 10
ServerLimit 45
MaxClients 45
MaxRequestWorkers 45
MaxConnectionsPerChild 2000
45 processes x 68 MB per = 3060 MB .
►► Digital Downloads ➜ www.cttstore.com
►► Reddit ➜ / christitustech
►► Titus Tech Talk ➜ / titustechtalk
►► Twitch ➜ / christitustech

Пікірлер: 18
@DDBAA24
@DDBAA24 5 жыл бұрын
Dude , you dialed back from this , I guess to reach a larger audience but a technical video like this is great to see. I started watching you regular after 'Drunk Arch Install' so I never saw this. The audience you have now wouldn't be with this , like you said your doing entry level pushing for the adoption of linux. Personally I think you should start doing some videos like this one for more advanced/technical users every once and a while.
@vrnchndk
@vrnchndk 5 жыл бұрын
Thanks for the video. Any way how to know which module is actively in use by apache, so that rest of them can be disabled ?
@ganztv3106
@ganztv3106 4 жыл бұрын
Hi..great video..very helpful..keep it up.THanks..anyway do you know where to edit this using Dockerfile?or where to place the configurations inside docker? we are using Wordpress in Azure.THanks
@madhukarkamble3520
@madhukarkamble3520 4 жыл бұрын
I need to know apache server optimization for large scale application where worker threads are working. So that willl be helpful for us. Thanks
@laurensjvg
@laurensjvg 5 жыл бұрын
Thx very usefull
@sebsefyu
@sebsefyu 4 жыл бұрын
Chris, you said you would do a video no optimizing Apache modules for minimum memory usage. Not sure you released it yet?
@jameskennedyjkwireless1509
@jameskennedyjkwireless1509 4 жыл бұрын
How would I apply optimizing to CentOS 7 ?
@GameBully2K
@GameBully2K 3 жыл бұрын
hey there i have 2vcpus and 1Gb what do you suggest?
@arkofimagination
@arkofimagination 3 жыл бұрын
Why can't I find apache2 folder in the folder etc? Is it because I don't install LAMP in my f-1 micro VM?
@clementmuhirwa
@clementmuhirwa Жыл бұрын
I have a server with 16cores cpu, 32gb ram, apache is only using 3gb RAM and when only 1000 users accesses the web apache automatically shuts itself down, I watched this video multiple times but I can't get how to increase apache memory at least from 3gb to 20gb something like that. anyone who might know the answer? thank you.
@benbeno893
@benbeno893 5 жыл бұрын
Does it makes any difference if one have workers module on micro instance running instead of prefork?
@ChrisTitusTech
@ChrisTitusTech 5 жыл бұрын
I believe so, workers module is meant for high traffic sites, so I imagine using it instead of the prefork would lead to performance issues.
@benbeno893
@benbeno893 5 жыл бұрын
@@ChrisTitusTech I don't quite get it. What would be the cause of this issues? I mean, if it is suitable for high traffic, why it would not perfom well with less trafic?
@ChrisTitusTech
@ChrisTitusTech 5 жыл бұрын
@@benbeno893 The overhead for workers is higher to maintain than prefork. So you need a beefy system to see the benefit. A micro instance is just a shared single CPU with half a gig of ram... That thing can maybe hold 5-10 concurrent users.
@benbeno893
@benbeno893 5 жыл бұрын
@@ChrisTitusTech Yep. I just calculated 8,5 for MaxClients
@benbeno893
@benbeno893 5 жыл бұрын
@@ChrisTitusTech prefork is running 66 sec. in stead of 76 for my 450 requests. Anyway, thank you for video and explanation. Cheers
@sunil951
@sunil951 3 жыл бұрын
MPM Event it best !!
@GreenHatHackers
@GreenHatHackers 3 жыл бұрын
Please try to use bigger fonts it sucks when watching your video on phone
Apache vs NGINX
7:53
IBM Technology
Рет қаралды 258 М.
But, what is Virtual Memory?
20:11
Tech With Nikola
Рет қаралды 228 М.
🌊Насколько Глубокий Океан ? #shorts
00:42
Alat Seru Penolong untuk Mimpi Indah Bayi!
00:31
Let's GLOW! Indonesian
Рет қаралды 15 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
Improve Phone Battery Life
9:03
Chris Titus Tech
Рет қаралды 36 М.
Linux Security - Securing Apache2
23:43
HackerSploit
Рет қаралды 58 М.
How to Choose a Linux Distribution
25:15
Chris Titus Tech
Рет қаралды 686 М.
Why is My Webserver Hanging?!? (Spoiler: It was PHP-FPM)
9:31
Shawn Powers
Рет қаралды 6 М.
Apache Virtual Hosts
40:20
Nerd on the Street
Рет қаралды 100 М.
Linux Problems
11:39
Chris Titus Tech
Рет қаралды 125 М.
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Рет қаралды 2 МЛН
Explaining File Systems: NTFS, exFAT, FAT32, ext4 & More
11:05
ExplainingComputers
Рет қаралды 1,3 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,3 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,7 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,6 МЛН