Life has calmed significantly. My new nephew will be here within weeks (there’s been some crazy health problems, but baby and mom are both doing well), I’m continuing to learn new things and be challenged at work (the challenge sometimes threatens to overwhelm me), the family is generally healthy (only one serious concern in recent history), and the love life is taking interesting twists and turns (I’m happy, and remaining cautiously optimistic and quiet about it). Overall, though, things are moving along nicely.

This post, though, has been brewing in my head for a bit, and today I’ve made the time to write it down.  It’s about a simple thing, to me: love.

If you’ve seen me around any of my family or close friends, you know that love and affection are things I give freely and often. I love without expectation of reciprocation or anything in return. I cannot think of a time that loving didn’t come as easily to me as breathing.

To clarify: to me, sex and love are not directly interchangeable. I have had sex with people I didn’t love, and I have loved people I didn’t have sex with. Too, love does not have different types for me. I love. I don’t love my mom more or differently than my brother, or my Ani more or differently than my current love interest. They all run together and come from the same place for me. I, obviously, will express my love for all of those people in different ways, but it all feels the same to me.

All of that said, I have moved to a position (At work, Socially, Mentally) recently that (it seems) faking affection is common, and generally accepted as the norm. I have exposed myself to (by trusting and loving) many people in the last year who have turned out to be completely different from the person I thought they were, or at least from the person they presented to me. I am struggling now with where to go from here. I am frustrated. All of the rules and boundaries I set up for myself after I got divorced were working so well until now. I can’t figure out what I blinded myself to in these situations, or what I could have done differently, or what the hell happened. You know, beyond the people in question using my openness to their advantage, and manipulating me into a position of trust.

If I accept that I was willfully deceived, and cannot find the misstep I took, or the flag I missed, I have an immediate urge to protect myself from that happening again. In other words: Stop trusting people. That… won’t happen. I crossed that bridge years ago, and accepted pain and discouragement as part of the price of living, but it’s still my first gut reaction. My unwillingness to cut myself off means, unfortunately, that I have to accept that this will continue to happen.

For this exact reason, I have become more cautious. Slower to love, slower to trust, slower to allow into the inner chamber of my heart. Mostly because I am so easily manipulated by the person receiving my love, once it’s expressed. I will blind myself to almost any problems with that person until I cannot ignore it any more.  The caution is a compromise I make with myself: you can still love, but maybe you should actually *know* someone, at least a little, before you express it to them.

The oddest thing, to me, is what happened when I accepted that loving people like I do meant I would get hurt: I stopped being mad at myself for allowing myself to be manipulated. I stopped being mad at people for hurting me. I stopped holding grudges and hating. I decided I didn’t have time for any of that, and everything came down to a single decision: Are you good for me or bad for me? If you’re bad for me, I stop hanging out with you. No drama, no hard feelings, no bullshit. I just stop hanging out with you. (There is certainly a middle ground here where I can have an affection for you, not love you, and still hang out with you, but for the purpose of this post I’m speaking in extremes.) That doesn’t mean that every friend I’ve lost over the last five years was due to them being bad for me, but slowly backing away has led to much less drAma for me.

If you’re good for me? I hold your heart closer to mine than you can possibly imagine, and make sure you bloody well know that I love you, unconditionally and completely. I don’t know of any other way to be. If you hurt me repeatedly or intentionally, you’ll probably lose me, but it won’t be until after you’ve gotten many chances. I forgive a lot too. But that’s for an entirely different post.

INTERNET! I must tell you. The comedy of errors continues, and I remain at DTW this morning. Why you ask?! LET ME TELL YOU.

So, last night, I arrive from Lansing in plenty of time for my 7:35pm flight. I’m at my gate early, everything is cool. Then, around 7, the flight is delayed 15 minutes. No big deal. I can entertain myself for 15 more minutes. Then it’s delayed an hour. …No, you know, it’s still cool. Shit happens. I got this.  Then, around the 8pm mark, and the lady comes back on the intercom to tell us that the flight is being cancelled. She’ll help as many people as she can, but any agent that’s not boarding a flight can help.  … you’ve GOT to be kidding me.

So, while half the flight lines up with her, the other half scatters. I found a guy that had just completed boarding a flight, and he got me rescheduled for this morning at 8:50, put me up in the Sheraton near the airport, and told me that if I wanted my baggage it was a 2 hour wait.

The seemingly intelligent woman behind the counter of the Sheraton last night set my wake up call for 6pm. Yes, PM. As in night time. So, when I woke up at 8:10am for my 8:50am flight? It didn’t go well. I got through security at 9:00am and am at my gate by 9:05am, and of COURSE the only flight that Delta runs on time is the one that I’m 15 MINUTES late for.

FINE. So. I went went to the help center, they told me I had to talk to an agent, or I could call this number. The line for the agents was ~10 people long, but then I saw that four of them were sitting on the floor and I says to myself “Self… go get in line, and call the number. See which works first.” The phone was answered in around 4 minutes, just as I was eyeing the ground under my feet strongly.  ”Oh, man. That’s just … let me see what I can do,” says the lady on the other end of the phone. As it turns out: I have three options:

DTW – > baltimore -> Atlanta -> Austin. Arriving at 4:30pm

DTW -> Pittsburgh -> Atlanta -> Austin. Arriving at 4:30pm

DTW -> Austin arriving at 9:50pm (same as last night’s flight)

“My concern is that last night’s flight was delayed an hour, and then cancelled. I REALLY don’t want to fly to another city just to have my flight cancelled and be stuck there.” “Okay, then let’s do this: I’ll confirm you for the 7:50 time, and you can get yourself on standby for the 1:50 flight that is currently completely booked.” I guess that’ll do.

SO. I remember that there’s a gate on the B concourse that is always staffed (B2, in case you’re following along at home), so I go there and I find an agent. She tells me the gate number of the 1:50pm flight (because apparently I have to go there and hope that it’s staffed and then hope they want to talk to me).

I go to that gate (A61), stand there and wait for 40 minutes while the woman that’s there finishes dealing with the flight that she was boarding/sending off. I finally get to the counter, and say “…Long story short: I’m confirmed on the 7:50 flight tonight, but I would very much like to be put on standby for the 1:50pm.” “No problem, let me … all I need is your boarding pass.” I hand it over to her. “*mumblemumblemumble* Here you go.”

I’ve heard a lot of bad things about Delta’s customer service. So far, other than the delayed/cancelled flight, they haven’t been too bad. This has been a HUGE pain in the ass. This is my first time flying delta in many years, and my first cancelled flight. Definitely makes me want to avoid them in the future.

When 2010 started I could tell it was going to be a banner year.  I felt the energy to make sweeping changes in my life, my outlook, and my direction. It’s been mostly happening in small doses, but recently we hit a big one: I bought my first car.

Now, I know what you’re thinking. You bought a car? It’s cool, yeah, but… well. I’m a bit of a driver.  I’ve been driving an ’03 Chevy Malibu since my Ex-husband bought it in ’03. It wasn’t a bad car at all, but it was definitely an old-man car.  When I started shopping I decided I wanted something hot. Something fun. Something closer to my personality.

I had NO IDEA what I was getting myself into. Honestly. Have you met me? Putting all of my personality in a car? But I did it. I found a car that was just the right amount of bad ass mixed with comfort. It stands out without being flashy. It’s just sexy. I fell completely in love the first time I drove it. I can’t even tell you how much fun it was to find it.

For me, this is a deal. A Big Deal. I mean, come on. I bought this:

Zeus

Meet Zeus

In the three weeks since Zeus and I met, though, we’ve had some adventures.

At the end of week 2, a very nice man accidentally backed into the driver’s side door.

Zeus's dented door.

Zeus's dented door.

It sucked, but you know. It is what it is. I’ve been working with the guy that hit it, and his insurance company to get it squared away. It’s been a slow process, but we’ve been making progress.

You know, until yesterday. When This. Woman. decided I shouldn’t have nice things.  And to try to go make her car occupy the same space as mine. Which always goes well.

Poor, undriveable Zeus.

Poor, undriveable Zeus.

So I had Zeus towed to the dealership, and he’s waiting there for Monday, when the insurance assessor will go talk to them mechanics. He probably won’t be fixed by the time I get back to Lansing on Wednesday night, but hopefully by the end of the week it’ll be all straightened out, and he’ll look amazing again.

OH YEAH. I guess I should probably tell you guys where I’m going? Austin, TX. For a thing called HostingCon. I’ll tell you all about it. Later.  Maybe.

I’m typically not very quiet about my love for road trips (or about anything else, really).  I adore the ability to get in my car and drive to an undisclosed (or unknown) destination just for the hell of it.

I have a flickr set devoted just to pictures I’ve taken while driving around.

Yesterday, I took a day trip to Richmond, KY.  We left promptly at 6am, and got to the Richmond area around noon exactly, around an hour ahead of schedule (what? *innocent look*), so we got off the freeway an exit early and drove over a much smaller bridge than the one that the freeway has.

Clay’s Ferry Bridge is a bridge that replaced an old style ferry that used to be used to take cars (and people and carriages and anything else you can imagine) across the river. These days, it looks like this:

Clay's Ferry Bridge

Clay's Ferry Bridge

We crossed over from the left of the picture to the right, and proceeded up the hill. About half way up, there was a turn off that looked like it had been torn up a bit, and there were two crosses there. We pulled over to look. The one was far older than the other, but this one was so new it struck me and I took a picture.

Grave, by Clay's Ferry

Grave, by Clay's Ferry

This was an absolutely gorgeous spot. The entire state is so beautiful, in a slightly different way from Michigan, and I love to visit it.

After we’d had our fill (as if that were possible) we continued on the way, and arrived at Aunty’s house, loaded up the car with tons of fabric, had some lunch at Ramsey’s in Lexington with The Aunty Betty, and the Cousin Kelsey.  Ramsey’s signature dish is called a ‘Hot Brown’, and looks like a heart attack on a plate:

Lunch

Lunch

The Cousin is pregnant and was due yesterday so we went walking for a bit in the Mall attempting to make baby Clarissa come on out.  We headed back to Lansing around 5, arriving back in town around 11.

The drives down and back were uneventful (except when I misread the highway sign on the way back, and got off on an exit in Dayton…) and it was slightly emotionally straining, but overall it was a good day.

I plan to make more trips like that. I miss the road.

Ask anyone who works with me, or is friends with me, and they’ll tell you:I struggle to find a balance between my work life, and my outside-of-work life. I am, by genetics and life-long-training, a workaholic. My bosses have always been able to count on me to get the job done, no matter what, and my family and friends have heard “I can’t tonight, I have to work,” more times than I feel comfortable admitting.

For the last year or so, I’ve been trying to spent more of my time doing things that I love that *aren’t* work, and I’ve been doing pretty well with it. The weekends are spent doing things I enjoy, and only sunday nights have been work time, really. I’ve taken more road trips, spent more time with my Mom, and The Kings, and I really truly feel more complete for it.

There are some pretty big things that upset this balance:

1) I overcommit. It’s not so bad anymore, since I’ve figured out that saying no isn’t bad, but I still do it. I automatically plan for 50 hours a week to be work, and sometimes promise 70 hours of work. Whoops.

2) People quit. It happens, people move on, but the people that have been in the company long enough to have a relatively complete picture are fewer and far between. Too, when they leave, the workload has to be shuffled around until it settles again. I’m called on to fill a lot of different roles, and I love that I get to do so many different things, but it’s definitely a challenge.

3) I like my social life. A lot. I hang out with some of the single most awesome people on the planet.

4) I make no effort to separate the two. If someone from work calls with a question or an emergency, I will generally drop what I’m doing and help them. Likewise in my friends and family. Too, I hang out with people I work with all the time, and like to include my other friends in the same circle.

This comes up now because I am experiencing some discomfort these days, and I can’t seem to identify it. I’ve eliminated physical problems as much as possible (bloodwork!), and have (both) spent weeks drinking, and weeks not drinking. I’m even (slowly) allowing myself to develop some feelings someone I’m sleeping with for the first time in 2+ years.

The discomfort manifests in odd ways. A strong defiance to clocking more than 10 hours of overtime, even if I do other work from home. An urge to travel more. Less explosive reactions to the things that upset me at work, and increased compassion for almost everyone on the planet.

All the while, though, there’s something fussing me, and it’s growing stronger. It’s quickly becoming an urge to hide. Or to run. I can’t tell which. But if I don’t figure it out this year there may be an explosion.

Anyway, this is pretty raw brain dump and rambling. And, now that I think of it, completely out of place for this blog. It’s been a long time since I put this much of my brain’s ramblings on the internet.

For the second year in a row Liquid Web submitted two chilis for the Lansing Board of Water and Light sponsored Chili Cookoff. This year, placed in b oth categories that we entered.

Chris and Jerry, with their awards.

Chris and Jerry, with their awards.

That’s bloody RIGHT. We do hosting AND chili.  You can see the rest of the set at flickr.

:D

Note: This is part 2 in a series on Apache in a LAMP environment. You can read part 1 here.

Now that we’ve covered the common directives, and how they relate to each other, let’s talk about some tweaks to make Apache hum in your environment. We will assume that you know where to find the referenced files.

What we’ll cover in this post is all contained here (a copy of my own VPS’s Apache directives).


KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 5
<IfModule prefork.c>
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 500
</IfModule>
<IfModule worker.c>
ServerLimit 5
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 500

Timeout 300

Understanding the implications of any changes you make to your configuration is essential, but a lot of that knowledge will come with experience. Here is my take on three of the directives, and some of the things you can do with them.

1: MaxClients.

This directive defines how many simultaneous and independent requests will be served by Apache. There are two things to consider before you change this setting.

  • What is the current setting?
  • By default Apache uses a setting of 150. This is a good starting point but it’s probably low for dedicated servers. Slowly ncrease it in increments of 25-50. If it’s already at 500 or 1000 then increasing it more may not be the right answer.

  • How much memory/CPU does your site take per page load? How much memory/CPU do you have left?
  • You want to allow pages to be served. You don’t want to crash the server. If your site is normally memory or CPU intensive and you don’t have much to spare you will want to think carefully before increasing it.

If MaxClients is reached new requests are queued rather than being served immediately. This will appear to clients like a really long load time. Check your error log for this error:

[Sun Jun 06 18:00:15 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting

There are a couple ways to handle this. The most obvious is increasing that number. You can also use a command like netstat to determine if there is a single IP address that has a lot of connections to port 80 on your server. My favorite piece of bash-fu:

netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -f1 -d: | sort | uniq -c | sort -rn | head

That will collect a list of all of the open connections to port 80 and sorts the 5th field in that string. Depending on your system you might need to tweak the line to sort by the correct field. The ‘Foreign Address’ field is the one you want.

Netstat

nestat -lnp | head

2. KeepAlive

KeepAlive is an on/off setting. It determines if a connection to the client will remain open after Apache serves its request. If your server is high traffic or is serving a lot of small and/or flat files then turning KeepAlive off can significantly reduce resource use by Apache.

Beware, though, that changing this directive is not as predictable as with the others. If you decide to change it on an a server that is experiencing problems at the time you should keep a close eye on your server’s load and your finger on the kill -9 trigger.

3: MaxRequestsPerChild

MaxRequestsPerChild defines how many requests a single Apache child would serve before it was killed and a new child spawned. In a shared environment this can be very helpful to negate the effects of memory leaks in the web server. By default this setting is 1000. A good value for this setting in a shared environment is 150% of your MaxClients directive.

If you are serving the same static, predictable content you can safely pump this directive up pretty high. This will decrease the amount of times that Apache has to kill and spawn new children. 10,000 is a good setting for higher traffic servers with stable/static content. If you like to live dangerously you can set it to ’0′ (unlimited). If you increase it beyond 150% you might consider writing a script that will monitor your server’s memory use and alert you if it gets too high.


Apache configurations are very subjective. Once you understand each directive you’ll find that you develop your own best practices. Since most configuration tweaks are born out of necessity you will probably find yourself making these changes under fire. Good luck. :)

How is it that, with as much caffieine as we ingest on a daily basis, sleepy still wins in a Google Fight?

Google Fight: Awake Vs. Sleepy

Google Fight: Awake Vs. Sleepy

The Ann Arbor Perl Mongers are a great, and still building steam, group of guys (no girls yet) that love perl. Dan and I went down to Ann Arbor for April’s meeting, and had a great time.

In April:

* Tommy Staton gave a presentation on ‘Syncing your ~ with Git’. It was well done, and somewhat controversial, and I learned a TON about Git, which is kind of awesome. Too, he used Voom (which allows you to write and show presentations in Vim) to write his presentation, and with my love of Vim, it was easy to like him.

* Jamie Pitts – gave a presentation about “Boilerplate Web Apps” (downloads his presentation) about Catalyst::Helper, which was incredibly detailed and quite revolutionary for me but… went immediately over my head. As a side note, I really REALLY need to learn Perl (which, incidentally, apparently is three classes deep in the Computer Sciences department at LCC… JUST GIVE ME A DAMN CLASS ON PERL)

This month Liquid Web (by which I mean me) offered to host the meeting. I asked our devteam if they wanted to present anything, and, to put it simply, they are far too busy with things I want them to be doing for LW. It was coming down to it, and it was becoming bloody apparent: I was going to have to present something. To the Perl Mongers.

Me. Who doesn’t know perl. ….shiiiiiiii.

But then my (quickly becoming good) buddy Mark suggested I talk about what I do know: why Perl Enthusiasts need to be their own Evangelists. I was 3/4 of the way through building that when Jamie (from the last meeting, remember?) and Mike Mol both offered to present, and my lead dev tells me that this topic was covered three months ago, at the same group.

SAVED!

Organize the event?! I can do that in my sleep.

Pizza, soda, technology, and places to sit. That’s all I had to come up with.

This Month:

* Jamie presented on the Architecture of a well written, multi-layer (and sometimes multi-application) perl application. It definitely engaged the LW devs and Engineering folk that made it out. This time I actually followed along with the concepts, but as soon as he started giving examples he lost me (have I mentioned how it would be a good idea to learn perl?). It was a good presentation, though.

* Mike Mol talked about his extremely cool project: Rosetta Code, which is exactly what you’d think it was. The base idea: write the same function/program/concept in as many different languages as you can. While relatively simple in concept, it is a huge undertaking. He’s grown his own community, and faced his challenges, and it was a joy watching him interact with my beloved engineering geeks.

After we broke (best two hours ever), I took the four out-of-towners on a tour of LW, showing them the one section of servers, and the huge generators, and the Awe-Inspiring that is the Datacenter I typically take for granted. They had questions about all sorts of statistics I haven’t committed to memory yet (Mental note: learn about the electrical infrastructure), but it was a spectacular end to the night.

All in all, it was an inspiring, tiring, and overall … experience. I’m amazed at, no matter how many times I do things like this, I always learn something new, or think of something I should have done differently or better.

A++ would do again.

Note: This is part 1 in a series. Currently, I think there are likely to be three parts (configuration explained, performance tweaks, and troubleshooting), but we will have to see as I write them. I really expected this to only be a single entry.

First and foremost, I have to give credit to Matt Aurand. He took the time to read the Apache docs, and distill them into something I actually read, comprehended, and can now spit back out to you. There are some large portions of this post copied directly from what he wrote, because I could not come up with a better way to say it.  The other huge resource is the Apache Docs (1). Huge, and dry. I tried to make it less dry, and more condensed.


My background with Apache is almost entirely in LAMP servers that have cPanel/WHM installed. While I have attempted to remove any and all assumptions based on that configuration, I’m sure I’ve missed some. Feel free to point them out, if you find them.


Apache is the most common and most popular web server out there(2). It’s free, stable, and easy to support. While it does work in a sort of out-of-the-box way, there are lots of things you can do to make your server (and the apache service) more stable.

What we’ll cover in this post is all contained here. This is a copy/paste of my own VPS’s apache directives.

KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 5
<IfModule prefork.c>
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 500
</IfModule>
<IfModule worker.c>
ServerLimit 5
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 500
</IfModule>

Timeout 300

MPMs:

The two most common MPMs (Multi-process modules) used with apache are mpm-prefork and mpm-worker. They’re both stable, and easy to use, but are good for very different things. Briefly: Prefork is non-threaded, and runs a lot like apache 1.3. Worker combines threading and non-threading and is extremely powerful.

According to the Apache docs, Prefork is:

This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other.

Worker‘s long description:

This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.

Follow the links for a complete description. For the remainder of this post, I will assume that you have a base understanding of Apache 2.0 and the two above MPM’s (hereafter called Prefork and Worker).

Which MPM should you use?

Apache comes by default with Prefork. If you’re using any modules that do not work correctly threaded, you should stick with prefork. Prefork is more stable, and built directly on known technology (Apache 1.3).

Prefork, however, also uses more resources on a normal server, and therefore does not always gracefully handle spikes or growth. Servers seeing bottlenecks at CPU or Memory should consider switching to Worker.

Worker shouldn’t be installed, though, if you have a compelling reason for each Apache request to be isolated. Since Worker is threaded, each child process handles multiple requests and may not be appropriate for what you need. It should be noted; a huge drawback to Worker is that if PHP has been compiled and installed to be used by Apache as a DSO, Worker will not work.

Directives

Each Module has 20+ directives that can be defined to alter the performance of apache. For the sake of brevity, I will give a brief description of each as we arrive at it, and link to where you can read more about it.

Common to both MPMs

For the full list, you can head over to the apache docs. I’ll just cover some of the most common.

Timeout $integer (Default 300) Apache#Timeout

Timeout can be set in the Server Config, or in individual vhosts.

Timeout, in seconds, controls how much time Apache will wait for the follow three conditions:
The total ammount of time it takes to recieve a GET request
The amount of time between receipt of TCP packets on a POST or PUT request
The amount of time between ACKs on transmissions of TCP packets in responses.

KeepAlive $(on|off) (Default on) Apache#KeepAlive

KeepAlive can be set in the Server Config and in individual vhosts.

The KeepAlive directive decides whether or not the connection is kept open to that client for further requests, after it serves its request. On mean yes, Off means no. “In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. To enable Keep-Alive connections, set KeepAlive On.”

MaxKeepAliveRequests $integer (Default 100) Apache#MaxKeepAliveRequests

MaxKeepAliveRequests can be set in the Server Config or in individual vhosts.

MaxKeepAliveRequests limits the number of requests that are allowed per connection when KeepAlive is on. 0 means unlimited. A good rule of thumb in a shared environment is 150% of your MaxClients. If your Site is static, stable, and on its own servers, this number can be safely increased to 1000 or more.

KeepAliveTimeout $integer (Apache Default 5, Cpanel Default 15) Apache#KeepAliveTimeout

This value can be set in the server config and in individual vhosts.

KeepAliveTimeout, in seconds, controls how long Apache will wait for a subsequent request from a specific client before closing the connection to that client. Having this value too high will cause performance problems on high traffic servers, because server processes will be occupied waiting on connections with idle clients. If KeepAlive is off, this value will not be read.

MaxClients $integer (Apache Prefork Default 256, Apache Worker Default ServerLimit X ThreadsPerChild, Cpanel Default 150) Apache#MaxClients

MaxClients can only be set in the server config.

MaxClients sets the limit on the simultaneous requests that will be served. Connections over this value will be queued, which is controlled by the ListenBacklog variable. Worker’s MaxClients must be equal to no more than ServerLimit X ThreadsPerChild.

MaxClients can be increased if a server is having trouble keeping up with legitimate traffic, and can vary greatly, depending on the type of content being served, the kind of server it is, and the amount of memory the server has. Increasing this value should be done cautiously, because if it is set too high you will see an increase in server instability, as each additional MaxClient causes apache to use more resources.

If you set prefork’s MaxClient above 256, the ServerLimit may also be also need to be set.

ServerLimit (Apache Prefork Default 256, Apache Worker Default 16) Apache#ServerLimit

This value is set in the server config.

With PreFork, ServerLimit sets the MaxClients for the lifetime of the Apache process. With worker, ServerLimit combined with ThreadLimit determines the server’s MaxClients. Please note that the ServerLimit cannot be changed via a restart. It requires that you stop and start apache. This Value does need only be set if you need to increase MaxClients above the server’s hard limit and has a hard-coded limit of 20,000 for worker and 200,000 for prefork. This is intended to avoid nastyness caused by typos.

MaxRequestsPerChild $interger (Apache Default 10000, Cpanel Default 0) Apache#MaxRequestsPerChild

This value is set in the server config.

MaxRequestsPerChild sets a limit on the number of requests each individual Apache process will handle before the child process is stopped. A value of 0 (infinity) will prevent any processes from expiring. If the content being served by Apache is stable (even if not static) this directive can be set quite high, to allow processes to serve more content.

StartServers $interger (prefork default 5, worker default 3) Apache#StartServers

StartServers is set in the server config.

StartServers controls how many child processes are spawned at startup. Please note that after start, this directive isn’t used. What value this should be set to is dependent on the type and size of CPU, as well as the amount of memory the server has. Due to the way apache works, setting this value lower than MinSpareServers or more than MaxSpareServers is counterproductive as it generally only puts extra load on the server itself.

RLimitCPU $interger|$interger (set in seconds) (Not set by default) Apache#RLimitCPU

RLimitCPU can be set in the server config, an individual domain’s vhost, a directory block or a .htaccess file in the domain’s docroot.

RLimitCPU determines the CPU limit for all *child* processes such as PHP or CGI processes, not the Apache children themselves. The first value is a soft limit and the second value is a hard limit. Either value can be set to a number or the word “max”. If you are on a VPS, it is strongly advised that you do not set this value, as it could cause significant problems for your host.

RLimitMEM $interger|$interger (set in seconds) (Not set by default) Apache#RLimitMEM

RLimitMEM can be set in the server config, an individual domain’s vhost, a directory block or a .htaccess file in the domain’s docroot.

RLimitMEM determines the MEM limit for all *child* processes such as PHP or CGI processes, not the Apache children themselves. The first value is a soft limit and the second value is a hard limit. Either value can be set to a number or the word “max”. If you are on a VPS, it is strongly advised that you do not set this value, as it could cause significant problems for your host.


If you’ve made it this far, congratulations. You now have a much more firm understanding of what Apache directive does, and how you can leverage it for your own server-worldly good.

Next week I’ll talk about the tricks I’ve picked up as a SysAdmin at a Web Host, and how they can help you.

__________________________________________________________________

References:

http://httpd.apache.org/docs/2.0/

2. http://news.netcraft.com/archives/2010/02/22/february_2010_web_server_survey.html