It Went Viral

Tonight, I felt pretty awesome, tuning a server, live, while I basically watched a website promotion go viral.  Fighting just to keep the (1) server up, while almost ten thousands users were trying to register for the free stuff!  I’ve never watched organic growth like that, in real-time.  Thanks Scott Christian for letting me be a part of the fun!

Moving from Apache to Nginx

So far, so good. I felt like I was cheating on an old friend. I’ve been hosting website on Apache since 1996. It was on FreeBSD back then. I can’t remember the name of the data center I was using. I think they were out of New Jersey. I talked to the guy on the phone several times. I liked that, and I try to provide that level of service to my clients too!

Anyway, I have been feeling the need to spread my wings a little bit lately. One of my favorite sysadmins, Sergei, was talking about Nginx in our last meeting. I figured if he is using it, it might be wise to at least give it a try.

Well, I’ve been using it for a few weeks now. I haven’t really done a side by side test. But what I have done, is look at my system memory and cpu usage stats. I’m using the exact same VM specs, in the same “region” and provider. With the exact same websites running, over a week of very similar traffic, the VM running Nginx and MariaDB is running with almost 10% less memory on average.

Yes, there are actually 2 variables on this VM, but isn’t MariaDB just a fork of MySQL? So far, I’m sold on this new stack. If the changes continue to outperform this way, I’ll be able to reduce the number of VMs I’m running, and reduce my resource related expenses going forward. Well worth the time and effort I’m putting in to learn about this new stack.

If you get the opportunity to try it out, I highly recommend you take it.

This first round of tests was on CentOS 7 VMs at Rackspace.

Another way to fail with mariadb

Sep 3 01:40:14 localhost mysqld_safe: '140903 1:40:14 InnoDB: The InnoDB memory heap is disabled
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Compressed tables use zlib 1.2.7
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Using Linux native AIO
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Initializing buffer pool, size = 128.0M
Sep 3 01:40:14 localhost mysqld_safe: InnoDB: mmap(137756672 bytes) failed; errno 12
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Completed initialization of buffer pool
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 InnoDB: Fatal error: cannot allocate memory for the buffer pool
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [ERROR] Plugin 'InnoDB' init function returned error.
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [Note] Plugin 'FEEDBACK' is disabled.
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [ERROR] Unknown/unsupported storage engine: InnoDB
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [ERROR] Aborting
Sep 3 01:40:14 localhost mysqld_safe: 140903 1:40:14 [Note] /usr/libexec/mysqld: Shutdown complete'

I was trying out the LEMP stack on a cloud server with only 512MB of RAM. With all of the other services running, mariadb-galera-server didn’t have enough free memory to startup properly.

Resizing the server to 1GB of RAM solved my issue!

Developer in Kansas City