'bash' Tag

  • Identifying main traffic sources with netstat and awk (one-liner explained)

    March 27, 2011

    This is just a short guide on how to find the main offenders in case of web server hammering. Sample of eventual output: netstat -natp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n | tail      25 195.150.23.130      25 67.222.164.140   [...]

  • Ruby on Rails served by unicorn with nginx for static files and reverse proxy on Ubuntu – detailed guide.

    March 10, 2011

    Ruby, the ever-so-popular scripting language and Rails – one of the leading web application frameworks are prone to serious performance issues if not served efficiently. Enter unicorn, a high performance replacement for mongrels and such. And of course, my goto tool for all things http: nginx. This is a short step-by-step detailed guide to achieving [...]

  • Dell servers power management settings in BIOS and performance impact

    March 1, 2011

    Ok so it all started like this: Bunch of web servers, all the same model (Dell R710), all functioning properly – however two of them are faster then the others (40% lower response time AND lower load average). Average connections to all the machines was identical. Hardware: Identical Software: Identical (to eliminate this as an [...]

  • Owner/Group/Permissions Synchronization

    February 11, 2010

    Image the following scenario: cd /etc chown root.root * -R OOPS You have just destroyed the server. This, and other similar mishaps (i.e. chmod 777 / -R) occur more often than one would imagine. If you are in luck like me, you have access to more than one linux server, and in most cases these [...]

  • Apache Cluster Config Sync

    January 11, 2010

    It has become quite commonplace today, for high traffic sites to require more than one web server. Here is a small script in charge of synchronizing the server configuration files (/etc/httpd in this example). In this case, I will be using apache as the web server of choice, simply because of its prevalence and popularity, [...]

  • MySQL Static Cache Daemon

    January 5, 2010

    The problem that this program was designed to solve is a rapidly changing MySQL table in use by a high-traffic website. For instance, stock quotes on the front page of a bank’s or investments firm’s site. The data is constantly updated by a service on the backend, and is referred to by some ajax widget [...]

  • RAID controller *NIX agent

    July 21, 2009

    When managing a large number of servers, it is most likely that you will come across a server that makes use of a RAID controller, and as such you will need to know the status of the disks and the disk array. As these are usually proprietary controllers, normal tools like ipmiutil, lshw, lspci, etc. [...]

  • Convert MySQL Tables: MyISAM to InnoDB

    July 20, 2009

    Not getting into the whole which engine is the best debacle, since obviously, like most important questions in life the answer is: “It depends.”

    In addition, most of what is written here can be used to convert from any engine to any engine, and thus answering any specific needs your might have.
    I needed to convert MyISAM to InnoDB so here it is.

    Without further ado…

    As far as I know, there are two basic ways to accomplish this:

    1.  ALTER TABLE 'tablename' ENGINE = InnoDB

      For each table in the database.

    2. Dump the table, edit the dump file where it says “CREATE TABLE” and fix to the preferred engine, and then reload the data back into the DB

    Obviously, these methods are ok when you are dealing with a few tables, however a while ago we had a client with a huge database with over 50 tables, so of course, a script was in place.

 
Powered by Wordpress. Theme by Shlomi Noach, openark.org
Hosted by Evolution On-line