Apr 30

Workaround for scoreboard is full not at MaxRequestWorkers

Error!

[Mon Apr 18 11:51:30.780477 2016] [mpm_event:error] [pid 13139:tid 139928749205312] AH00485: scoreboard is full, not at MaxRequestWorkers

You are here because your Apache server got hung and error log is full with above “[mpm_worker:error] scoreboard is full not at maxrequestworkers ” error. Unfortunately this is long time reported bug on Apache event mpm which can find at here . since this bug is not yet fixed at Apache event mpm, many experts are suggesting to move into either Prefork mpm or Worker mpm which is quite similar to event mpm. Also some communities suggests to degrade the Apache version into 2.
Specially on production environment , it is really hard to move into from one mpm to another or downgrade the Apache version. Sometimes those older version may contains vulnerabilities or not support required features, so downgrade is not a good solution at all the time.

Here I’m looking to discuss workaround for this error / bug . It’s better to remember there is nothing much to do with Apache configuration, because it’s a bug. But if you are lucky enough following workaround may work for you.

Below is my server environment
OS :- Centos 7
RAM :- 12 GB
Apache version :- 2.4.16

You are to edit httpd.conf and then later going to restart Apache , so make sure you should have sufficient permission to do those tasks(need to root privileges).

01) Open httpd.conf file

02) Find event mpm configuration snippet

 

Set event mpm directives values like below , hopefully you have change according to your environment. For more details read below .

 

03)Directives which fix scoreboard is full not at maxrequestworkers error

I would like to discuss import directives (variable) which you need to adjust in order to solve  “[mpm_worker:error] scoreboard is full not at maxrequestworkers” error

You can refer variable definition in more depth from official Apache documents

MaxClients :- in new Apache version this variable called as MaxRequestWorkers. this value is calculate by multiplying
ThreadsPerChild and ServerLimit . by raising MaxClients / MaxRequestWorkers you can expand Apache server scoreboard.

MaxRequestsPerChild :- It is no of request child can handle. default value is 0 , it means child will handle unlimited request. set the the value to 0 (or comment it then it will be assigned default value of 0 ).

GracefulShutdownTimeout :- Reduce this value something around 5 seconds. so Apache itself remove request which is on Graceful state.

MinSpareThreads , MaxSpareThreads :- here use default value, some documents recommend to increase the gap between two variable by something like this.
   MinSpareThreads = MaxRequestWorkers / 4
   MaxSpareThreads = MinSpareThreads * 3

MaxKeepAliveRequests :- This is outside to the event mpm variable scope. Apache itself destroy keep alive request greater than to this variable. Here the variable define on global level which means it will apply to all Apache virtual hosts , but you can set it on Apache virtual host level if you wish.

Please give your thoughts about this workaround, I’m always happy to hear them and give my opinions.

Apr 27

How to setup home folder to Active Directory user

This article guides you how to assign Home Folder to Active Directory users. Home Folder also called as Network folder in some documents. Home Folder make it easy administrator task by providing users to backup their files some times entire user’s files are residing on single location or NAS. The most useful feature I have found is that home folder can roam to any computer within the domain where user is log in. Here I would like to discuss how to setup home folder to Active Directory user and assign disk quota per user.

Environment :- This is done at Windows Server 2012 R2

So let’s look at how to setup Home Folder per user. Tutorial is divided into two part to make it more clear to understand the process.

[01] Configure Disk quota

1) “File Server Resource Manager” should be installed on Windows server. If it is doesn’t

i) open Server Manager
ii) Go to “Add roles and features
iii) Inside “Add Roles and Features Wizard” you have to NEXT each until reach “Server Roles” , I skip those steps here but remember you need to set some values there.
File Server Resource Manager
iv) In “Server Roles” expand “File and Storage Services“, again expand “File and iSCI Services“, then tick “File Server Resource Manager” and click “next” to install.

2) configure disk quota for user network folder

i) Create shared folder ex:- D:\HOME
ii) Open “File Server Resource Manager
iii) Expand “Quota Management” , you can configure “Quota Templates” if you wish or you can use existing template like here I did.
iv ) Click on “Quotas” –> “Create Quotas” from right hand side.
v) On then “Create Quota” window, browse and set Quota Path, select “Auto apply template and create quotas on existing and new sub folders” radio button, and make sure to select previously configured template from the drop down menu (200 MB Limit Reports to User – existing template).
Create Quota

[02] Configure Home folder / Network Folder

Open “HOME” folder properties

1) Set folder sharing

i) Click on “Share” button and activate folder sharing
Find shared folder path ex:- “\\YOUR-SERVER\home\

2) Disable inheritance

i) select “security” tab and then open “Advance Security
ii) Please make sure inheritance is disabled like below.
inheritance disable

3) Attach Network folder to Active directory user

i) Open “Active Directory Users and Computers
ii) Right click on user and open “properties” , then browse “profile” and set following Network path there.

\\YOUR-SERVER\home\%username%
set shared folder

 

iii) Re-login to machine and Home folder should be appeared like below

Network Folder

Apr 21

Automatically Backup MySQL Databases on Windows

Unlike on Linux, when MySQL is running on Windows, most of sys-admins including myself 🙂 found that backup MySQL Databases on Windows is little bit hard. When trying to automate it, then it would definitely become challenge . However there are lots of free and commercial tools are available to automate MySQL backup process on windows. Here we are going to discus how to achieve same using simple windows batch script. Later we discuss automate the batch script using Windows task scheduler

 

01) Create batch file

Open notepad and save following script as batch file (.bat) and make sure to change all SET parameters as you need. If you install XAMPP then mysqldump.exe location  would be similar as below otherwise you need to change it.

02) Automate the MySQL Backup process

i) Open task scheduler

Open a command prompt. To open a command prompt, click Start , click All Programs , click Accessories , and then click Command Prompt .
At the command prompt, type Taskschd.msc .

For alternative options refer this :- https://technet.microsoft.com/en-us/library/cc721931.aspx

ii) Create New Task

Task Scheduler - Create Task

Click on “Create Task…” from right hand side. it will open up “create task” sub windows

please make sure to select “Run whether user is logged on or not” and tick “Run with highest privileges“. You may can change user but
recommend to select user with admin privileges , later you may need to provide credentials of that user.

iii) Schedule the time

From “Triggers” tab select how often back process should happen and it’s time

iv) Set backup process script

From the “Actions” tab select previously saved bat file.

v) Click “OK” and save the task

That’s it, 🙂  feel to comment here if you any doubts.

Older posts «

» Newer posts

Fetch more items