How To Use GeoIP2 (mmdb) Database With Perl

Published on Author gryzli

This article is the result of my struggles to properly use GeoIP v2 database within Perl.    TL;DR  The FASTEST way to use the database is by installing and utilizing the “MaxMind::DB::Reader::XS” perl module.  And here is a tiny example: use MaxMind::DB::Reader::XS ;  use Data::Dumper;  my $geoip_country = MaxMind::DB::Reader::XS->new( file => ‘/usr/share/GeoIP/GeoIP2-Country.mmdb’ ); print Dumper… Continue reading How To Use GeoIP2 (mmdb) Database With Perl

Calculate Maximum MySQL Memory Usage

Published on Author gryzli

Recently I found the following script pretty handy for calculating the maximum amount of memory mysql could use, based on the current buffers configuration.   This is the source: #!/bin/sh# you might want to add some user authentication here mysql -e “show variables; show status” | awk ‘ { VAR[$1]=$2 } END { MAX_CONN =… Continue reading Calculate Maximum MySQL Memory Usage

Detailed CPU Usage Overview With psacct

Published on Author gryzli

If you ever asked yourself the following questions, this might be the right place for you: How to check how much cpu is consuming each system user ? How to check how much cpu is consumed by each command ? Check when a command has been executed and how much cpu it did ? How… Continue reading Detailed CPU Usage Overview With psacct

Configuring KeepAlive with Apache RewriteRule [P] Proxying

Published on Author gryzli

Apache can be used for proxying requests with mod_proxy to a certain backend/upstream server. Here is how a simple proxy configuration looks: ProxyPreserveHost On RewriteEngine On RewriteRule ^/(.*)$ http://192.168.1.1:8080/$1 [P] The Problem The problem with this configuration is that Apache will create new TCP session to backend (192.168.1.1:8080) for every new request it receives. This… Continue reading Configuring KeepAlive with Apache RewriteRule [P] Proxying

ModSecurity – Using Lua scripts with ModSecurity

Published on Author gryzli

If you decide to use ModSecurity ‘s support of  Lua, here you can find some usefull tips to consider. Short story … At the time of writing this article, the current ModSecurity version is 2.9.0, which provides plenty of functionalities. However if you want to go deep into web application filtering or maybe you need to… Continue reading ModSecurity – Using Lua scripts with ModSecurity

Make Your WordPress At Least 3x Faster By Migrating To Nginx + PHP-FPM

Published on Author gryzli

If you want to make your WordPress at least 3x faster , then you should definitely read below…. Yesterday I woke up, and my first thought was – I need to make my WordPress blog faster !   Caring about performance ! That’s a great idea and most of the time, there is bunch of… Continue reading Make Your WordPress At Least 3x Faster By Migrating To Nginx + PHP-FPM

Qmail – Speed up mail sending process by tunning tcpserver settings

Published on Author gryzli

If you want to speed up qmail/tcpserver sending mails, you could try the following: 1. Open the file supervise/qmail-smtpd/run 2. Change the following line: /usr/local/bin/tcpserver -v -p -x TO /usr/local/bin/tcpserver -R -D -v -p -x This will enable TCP_NODELAY (-D option) and also disable attempts to resolve $TCPREMOTEINFO (-R option). 3. Info about tcpserver options General… Continue reading Qmail – Speed up mail sending process by tunning tcpserver settings

Calculating filesystem stride_size and stripe_width for best performance under RAID

Published on Author gryzli

Here is a little howto on calculating the right stride_size and stripe_width when creating new ext4 filesystem. This makes sense when you are running either on hardware or software raid under linux.   What is stride size and stripe width ? These two parameters could be supplied to mkfs.ext3/ mfks.ext4, during the filesystem creation. By… Continue reading Calculating filesystem stride_size and stripe_width for best performance under RAID

Magento Performance Optimized Server

Published on Author gryzli

I’ve read some articles on magento performance tuning and server optimization for best result. Here I will try to summarize most of the important stuff I’ve read.   Server Software Magento best practices advice on using the following configuration: Nginx + MySQL + php-fpm (FastCGI) + APC / OpCache + (Varnish) It’s better to use… Continue reading Magento Performance Optimized Server

Web pages performance testing

Published on Author gryzli

Very often I need to test some page speed and using bunch of websites, which produce very detailed information.   Here are some of them:   http://www.webpagetest.org/ This is the first one I’ve been using for a long time. Here are some of the features it supports: Select location from which the tests are going… Continue reading Web pages performance testing