Categories
09/05/2014
Linode升级完成 与DigitalOcean磁盘性能不全面对比
By dch1 in Web Log No Comments Tags: DigitalOcean, Linode, SSD, VPS
自4月17日Linode宣布升级以后,日本VPS服务器需要等待3周时间才能进行升级。到5月8日刚满3周,今天早上发现升级已经就绪,在10分钟之内便完成了VPS关机–数据转移–新主机上线的操作,还是比较迅速的。
升级时数据迁移速度大概在60M一秒左右,大概是0.5Gbps的传输速率,还是可以的。
升级概览:
新的VPS PLAN内存翻倍;
月流量从2TB提升到3TB;
从机械硬盘升级到SSD固态硬盘;以及,
CPU核心数从共享8颗CPU下降到独享2颗(这也是官方博客评论里大家最担心的“升级”,但之后评论反馈来看,由于CPU升级再加上固态硬盘速度提高,大多数站长反应系统性能反而有提升,这从侧面再一次证明了机械硬盘速度才是制约系统速度的瓶颈。)
好戏当然在后面,由于之前DigitalOcean给了$10USD的Credit,便有了现在这个测试项目,既然现在两大主机商都升级到SSD硬盘,那我们不妨用相同的命令测试一下磁盘性能。
测试环境:
Linode |
DigitalOcean |
|
CPU |
Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz |
Intel(R) Xeon(R) CPU E5-2630L@ 2.00GHz |
vCore |
2 |
1 |
RAM |
2048MB |
512MB |
HDD |
48GB SSD |
20GB SSD |
Bandwidth |
3TB |
1TB |
Monthly Fee |
$20 USD |
$5 USD |
Location |
Japan – 日本 |
Singapore – 新加坡 |
记得之前在老主机上测试过磁盘写入速度,我直接复制了前一篇博客的命令来做个对比:简单做了一个表,从表中可以观察到,本测试是一个不完整对比。Linode最低档次的Plan月费都是DigitalOcean的4倍,不能用鸡蛋碰石头,但我要试图搞清楚如此大的差价性能究竟差多少。由于时间所限,测试没有取平均值,也没有换不同机房进行同样测试,但都是在同一时段完成的。
$ sudo dd if=/dev/zero of=test bs=64k count=4k && rm test
4096+0 records in
4096+0 records out
268435456 bytes (268 MB) copied, 0.277739 s, 967 MB/s (284MB/s) vs. 201MB/s – 1.33262 s
$ sudo dd if=/dev/zero of=test bs=1M count=256 && rm test
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 0.229681 s, 1.2 GB/s (348MB/s) vs. 167MB/s – 1.60812 s
$ sudo dd if=/dev/zero of=test bs=64k count=4k oflag=dsync && rm test
4096+0 records in
4096+0 records out
268435456 bytes (268 MB) copied, 1.4939 s, 180 MB/s (60MB/s) vs. 17MB/s – 15.7993 s
红色是Linode升级SSD后的速度,蓝色是Linode升级前的机械硬盘速度,橙色是DigitalOcean的SSD硬盘速度。保守估计Linode升级前后整体磁盘性能提升至少三倍以上,而DigitalOcean号称是SSD磁盘的速度还不如Linode机械硬盘速度,更是Linode升级SSD之后测速的零头还不到。即便排除服务器个体差异(由于测试没有多次取平均值等等),但仍不清楚DigitalOcean这所谓的SSD是什么级别的品质(莫非是三星840 TLC,或者是SSD Cache硬盘?)……
结论:同样号称是SSD平台,DigitalOcean和Linode磁盘性能相差高达10倍(但价钱只差4倍)!正所谓一分钱一分货(You get what you pay for!)。
===========补充===========
为了尽可能客观公正,我于5月11日再次测试DigitalOcean磁盘写入速度。下面是截图:
可见磁盘速度有所提升,较上一次个别项提升了两倍还多,证明DigitalOcean磁盘性能波动很大,但仍然和Linode差的比较远。基本上DO的SSD性能和Linode升级SSD前的机械磁盘阵列差不多。
Linode 升级SSD前 |
Linode SSD升级后 – 5月9日 |
Linode SSD性能提升 |
DigitalOcean – 5月9日 |
与Linode升级前机械硬盘性能 |
与Linode升级后SSD相比 |
DigitalOcean – 5月11日 |
与Linode升级前机械硬盘性能 |
与Linode升级后SSD相比 |
|
64K * 4K |
284 MB/S |
967 MB/S |
340% |
201 MB/S |
71% |
21% |
235 MB/S |
83% |
24% |
1M * 256 |
348 MB/S |
1.2 GB/S |
345% |
167 MB/S |
48% |
14% |
394 MB/S |
113% |
33% |
64K * 4K (无缓存) |
60 MB/S |
180 MB/S |
300% |
17 MB/S |
28% |
9% |
34 MB/S |
57% |
19% |
===========补充结束===========
但并不是说DigitalOcean就没有任何优势。实话说,DigitalOcean最大的特点就是便宜,做实验用主机或者测试平台还是可以的,但长期建站稳定性有待考验。实惠与否还是需要看站长们自己的评判标准了。PS:新加坡机房到北京联通速度时好时坏,有时候丢包很厉害。
新Linode的Plan探针测速也是脱颖而出,超越了探针所有的老旧数据(这并不意外,那个年代都是机械硬盘嘛)。
05/06/2014
Install curl Module under Nginx+FastCGI (Nginx+FastCGI环境安装curl插件)
By dch1 in Web Log No Comments Tags: VPS, Web Design
Situation: I had an issue today when I was trying to upgrade the “WordPress Mobile Pack” plugin from WordPress. The wp-admin page remained blank so I was wondering something went wrong. I tried to delete the WMP plug-in and re-install it, but it was still the same problem.
Action: After I read the error_logs under my website folder, I grabbed the information as follows:
I made a note on official website to let them know:
http://wordpress.org/support/topic/makes-my-wp-admin-page-because-of-a-php-error-in-the-plugin-files
There were multiple error_logs but they just got repetitively. It said that curl_init() is undefined. Now everything came to a turning point.
Result: I did some research and I realised that CURL is a function of PHP so I need to get it installed.
However, I tried to restart the php5-fpm and Nginx service in Debian but nothing happened (I got a PHP probe installed to check whether the module installed correctly). I tried to reboot the machine and everything was working again!
Hint: Do NOT try to edit the php.ini (put “extension=curl.so“) after you get curl module installed. The module package will automatically put a file called “20-curl.ini” under /etc/php5/cgi/conf.d so the curl module will start with the program.
The probe program is found to be very useful during troubleshooting, however you can use phpinfo instead.