IT Knowledge Base

Technical Repository

HowTo: MySQL thread_cache_size Tuning

MySQL> SHOW GLOBAL STATUS LIKE ‘Connections’; +—————+——-+ | Variable_name | Value | +—————+——-+ | Connections | 8608 | +—————+——-+ 1 row in set (0.01 sec) MySQL> SHOW GLOBAL STATUS LIKE ‘Threads_created’; +—————–+——-+ | Variable_name | Value | +—————–+——-+ | Threads_created | 102 | +—————–+——-+ 1 row in set (0.00 sec) MySQL> SHOW GLOBAL STATUS LIKE […]

Read More


HowTo: Enable Linux ZRAM Compression

ZRAM compression ( compressed swap residing in ram / over allocating memory ) A successor to compcache, zram is fully integrated in the Linux kernel and uses lzo compression. Compress memory on the fly to reduce swapping. Uses a small amount of cpu, however the reduced i/o usage more than makes up for this. Note: We […]

Read More


HowTo: Linux – Configure SSH-Key Based Authentication

Let’s assume that you have two servers, ServerA and ServerB. You want to be able to be able to use certificates to log onto ServerB from ServerA without having to type in a username and password. To do this, we need to generate a public and private key pair on ServerA and then copy ServerA’s […]

Read More


HowTo: Configure Lighttpd to redirect HTTP to HTTPS

$HTTP[“scheme”] == “http” { # capture vhost name with regex conditiona -> %0 in redirect pattern # must be the most inner block to the redirect rule $HTTP[“host”] =~ “.*” { url.redirect = (“.*” => “https://%0$0”) } }

Read More


HowTo: Nginx/PHP, Fix the “Upstream sent too big header while reading” error

tail -f /usr/local/nginx/logs/error.log [error] 17142#0: *4 upstream sent too big header while reading response header from upstream Add this to your http {} of the nginx.conf file normally located at /etc/nginx/nginx.conf: proxy_buffer_size 128k; proxy_buffers 4256k; proxy_busy_buffers_size 256k; Then add this to your php location block, this will be located in your vhost file look for the block that begins with location […]

Read More


Fix: Ubuntu 14 Resolve.conf not dynamically updating with nameservers

sudo dpkg-reconfigure resolvconf

Read More


HowTo: Linux – How to find out which file system is causing the DF command to hang

If you type “df -k” in a terminal window, and the command hangs (does not return), to find which filesystem is causing the hang: 1. Type mount -p to print the list of mounted file systems: # mount -p 2. Now type your df command again: # df -k Compare the output of the two commands, […]

Read More


HowTo: Optimize MySQL Tables

Optimize a specific table mysqlcheck -u [username] -p[password] -o [database name] Optimize all tables mysqlcheck -u [username] -p[password] -o –all-databases

Read More


HowTo: Linux Shell Scripting – Concatenate two variables with an underscore.

Wrap each variable in a curly brackets. #!/bin/bash _Directory=$/backups/ _FileName=$myfiles.bak echo ${_Direcotry}_${_FileName}) Output is: /backups/myfiles.bak

Read More


HowTo: Configure RedHat for ISCSI SAN Access

Install iSCSI Initiator Utils, Install Device Mapper Multipath and lsscsi # sudo yum install iscsi-initiator-utils # sudo yum install device-mapper-multipath # sudo yum install install lsscsi Find the name of the initiator server in the file /etc/iscsi/initiatorname.iscsi. In this example, the name of the server is iqn. # cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1994-05.com.redhat:46bf8e2794f Let’s change the initiator […]

Read More