Tag Archives: linux

€2.99/mo. Scaleway VC1S

Same tools, same OS as $5/month: DigitalOcean vs Vultr

dd write bs=4k count=10k  100k  1M
                     403   398  184 MB/s
dd read bs=4k 
2.0 GB/s
sysbench --test=cpu --cpu-max-prime=10000 run
17.9875 sec.
stress-ng --cpu 1 --cpu-method all -t 30
94.22 ops/sec

The disk performance is comparable to those of DO/Vultr. But, even equipped with 2 x 64-bit x86 processor, CPU performance is lower than single core on $5/mo. VPS of DO/Vultr.

Since I use them as a web server, so I run ab -n500 -c500 requesting phpinfo() ..

Vultr:    2102.08 req./sec
Scaleway: 1543.10 req./sec


$5/month: DigitalOcean vs Vultr

Tools: dd, sysbench, stress-ng. I know,  you’d say they are NOT benchmark tools. I don’t care, I just need quick tests.

Here we go:

dd write bs=4k count=10k   100k  1M
do:                  350   465   424 MB/s
vultr:               699   538   466 MB/s
dd read bs=4k
do:    475 MB/s
vultr: 2.7 GB/s
sysbench --test=cpu --cpu-max-prime=10000 run
do:    14.2562 sec.
vultr: 13.7561 sec.
stress-ng --cpu 1 --cpu-method all -t 30
do:    154.15 ops/sec
vultr: 186.38 ops/sec

/me .. goes vultr.

do-release-upgrade and PHP7

16.04.1 ออกมาได้ประมาณหนึ่งสัปดาห์ 14.04 ก็เริ่มจะ upgrade กันได้ วันนี้สั่ง do-release-upgrade เรียบร้อยดี

ลง PHP7 เพิ่ม / เอา PHP5 ออก / แก้ไข socket path = เว็บกลับมาปกติ

ง่ายเกินไปนะ :P


วันนี้ ceph เดี้ยง

สืบพบว่ามาจาก monitor node 2 ใน 3 ตัว ..  ทั้งสองตัว เป็น VM connect ได้ daemon running  แต่ disk ของตัว host เป็น read-only .. พอ monitor พยายามบันทึกข้อมูลลง disk ไม่ได้มันก็ค้าง พอ monitor ค้าง ceph cluster ทั้งก้อนหยุดทำงาน

ได้ใช้ท่า troubleshooting: stop monitor / dump monmap / ลบ monitor node ที่ใช้งานไม่ได้ออกไปจาก monmap / inject monmap ตัวใหม่เข้า monitor node ที่ใช้งานได้

restart monitor

คืนชีพ (^^)v

Graylog Extractor for Fortigate Firewall

I’ve been using Graylog in production for awhile. It’s a great log analysis tool, backed by elasticsearch. Conceptually, graylog is pretty much like splunk. I consolidate approximately 170-200 million log messages to graylog everyday. So, I need to optimize them well enough.

Few days ago, I started to use Fortigate extractors from a git repo. It uses regex, and it is very slow. So I (have to) write my own extractors. I write Grok pattern, and keep rewriting until I could cover all messages I need to extract. Then, I started to optimize the pattern. The result is quite good though. I could reduce extractor time from more than 100,000 usec to about 100 usec.


Yes, that’s approximately 1000x times faster. It’s definitely not perfect though, but it works for me. If you think it might be good for you, you can download my Fortigate content pack here.

Enjoy :)


dnsmasq is the default DNS resolver if you use NetworkManager. It runs pretty well most of the time. When it doesn’t, you would not be able to access the Internet if you need to resolve names.

I’m not a fan of dnsmasq, and if you – like me – want to disable it, just edit


and remove/comment


Restart NetworkManager, it will use traditional faithful method of /etc/resolv.conf.

Quick install graylog on Ubuntu

Yes, yes, I know. There is the official document to guide you, e.g. http://docs.graylog.org/en/2.0/pages/installation/operating_system_packages.html

BUT, RTFM ! You need to install Java, MongoDB, elasticsearch config, and ensure they run well BEFORE you can run Graylog. That would need skills and time to do it right.

For those Ubuntu people, there is another way. Graylog officially (and constantly) releases a single deb package to update the OVA version. This package includes everything you need to run Graylog, so you can use it to deploy Graylog.

You can simply download the package at https://packages.graylog2.org/omnibus, dpkg -i to install, graylog-ctl to configure and run.



Remount tmpfs

This is simple, and you can do it without rebooting the machine.

For example, let’s say you have /tmp using tmpfs, and you want to set size to 4 GB:

# mount -o remount,size=4G,noatime /tmp

That’s it.

IBM AMM USB keyboard issue

Many admin faced an issue when using a USB keyboard on IBM Advanced Management Module (AMM) with Linux.

It seems that some Linux distros do not recognize USB device on IBM AMM and then power off the USB port, disconnect a device plugged in.

The solution is quite straightforward: always supply the power to the port.

With udev, you can add the following rules


ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04b3", ATTR{idProduct}=="4002", TEST=="power/control", ATTR{power/control}="on"