You are not logged in.
Hi,
I'm on a VPS for 256 MB of ram planning to run Apache and PostgreSQL.
Does anyone have recommendations on some settings to use so I can avoid blowing up the server with memory problems due to unnecessary spawning of workers or something like that?
Thanks.
Offline
Have a look at /etc/security/limits.conf to be able to limit the number of processes, memory etc per user... You'll have to experiment with what settings work best.
You can also play with the settings in /etc/httpd/conf/extra/httpd-mpm.conf to tweak Apache.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Anyone have experience or examples with tweaking apache/postgres that could show something?
Offline
Try lighttpd. This should perform better and uses less memory.
Offline
Well, I'm using Apache, it's the setup I'm going with and I need it for a specific module.
I really am just looking for optimization tips on Apache w/ the worker configuration and such as that. Likewise for similar settings on Postgres.
Offline
Well, I'm using Apache, it's the setup I'm going with and I need it for a specific module.
I really am just looking for optimization tips on Apache w/ the worker configuration and such as that. Likewise for similar settings on Postgres.
What module do you need for Apache that isnt in lighttpd? Just curious as I'm switching to lighttpd and I thought most stuff would run on it.
Offline
apache:
* remove unused modules
* if you are using php, then look at how much each apache instance uses normally, and tune maxclients, minspares, etc. accordingly
* if you are not using php, do the above, and also give worker-mpm a try (as it is *more* threaded an does less forking, it should use less ram and have less ram churn)
postgres:
* no idea, but a google search turned up some info for me
However, in all honesty, apache with any reasonably sized php app is going to need more memory, when combined with a database. So I would personally either use a lighter weight webserver, or upgrade to a 512 slice...which would be alot more roomy, and provide better overall results.
Another source of info: http://forum.slicehost.com/comments.php … sionID=129
Good luck.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Thank you very much
Offline
general principles always apply: use the absolute minimum number of modules. it's great for security, performance, and simplicity of configuration/maintenance. Apache comes with a boatload of modules these days, and you really usually need only a few. The default config should be OK performance wise unless you're really planning on some heavy traffic.
Postgres is another story tho. There are no modules, but the default config is absolutely minimalistic, it's intended for one local developer and that's it--even the network connectivity is disabled by default! Postgresql LOVES memory. the more you give it, the better it's gonna run. of course if your db is 10mb and you give it 100mb then you wont benefit much from the extra memory, but if it's 10mb and you give it 1mb then you're gonna be running very slowly. try to fit the whole db in memory if possible. postgres' memory allocation parameters are _extensive_. if you like to tweak for performance, you'll go gaga over them.
Generally tho, you won't know what settings you need until you load your data, your site, and you let it run under a normal load for a while. watch your logs like a hawk and 'learn' your site, how it runs, what gets accessed when, how the db is being used, is the system cpu or io bound, etc... THEN you can start really adjusting stuff. Donald Knuth said once that "premature optimization is the root of all evil" and running your own site will definitely demonstrate that. Log everything, otherwise you'll have nothing to learn from.
Offline