DreamHost 的 php.cgi

這幾天我收到 DreamHost 寄來的信,說我使用的 CPU resource 超過合理使用的範圍:(有點長,所以我只挑出了重要的部分)

Unfortunately it appears that your site is using more than your fair share of system resources on your shared hosting machine pizarro. Our system has flagged your account because it is using a large number of CPU minutes per day on pizarro. We need you to trim down your resource consumption considerably. Should you ignore this or subsequent warnings your account may be moved to an evaluation server which could cause downtime.

Specifically gslinn's CPU minute usage for today is 73.01.

我到 shell account 上看了紀錄,發現都是 php.cgi 在吃 CPU resource:

Process               CPU seconds      user   machine   count  average
php.cgi                 3374.4700   86.183%   14.060%   13544    0.249
awstats.pl               534.4000   13.648%    2.227%     498    1.073
sh                         4.7500    0.121%    0.020%     492    0.010
tcsh                       1.1100    0.028%    0.005%      14    0.079
vim                        0.5200    0.013%    0.002%      10    0.052
sshd                       0.1100    0.003%    0.000%       4    0.028
cat                        0.0300    0.001%    0.000%      11    0.003
ls                         0.0300    0.001%    0.000%       8    0.004
sendmail                   0.0200    0.001%    0.000%       1    0.020
w                          0.0200    0.001%    0.000%       3    0.007
postdrop                   0.0100    0.000%    0.000%       1    0.010
----------------------------------------------------------------------
Total:                  3915.4700  100.000%   16.314%   14586
Average per day:        3915.4700    1 days
CPU percentage assumes 24000 cpu seconds per day total.

這讓我哭笑不得 :p 也許還是跑 mod_php4 好了,這樣 CPU resource 就不會算在我頭上了?XD

PS:在 What are CPU minutes? 這頁有一堆人這幾天在幹剿 XD 大概是 DreamHost 這幾天升級 php 升到某個 resource 吃比較兇的部分造成的?

FreeBSD 6.0 MySQL Performance

I use databases/mysql50-{client,server} and use benchmarks/super-smack to test. There are 3*2*2*2 = 24 cases:

  • Compile options: none, WITH_PROC_SCOPE_PTH=yes, WITH_LINUXTHREADS=yes
  • /etc/libmap.conf: none (libpthread), libthr
  • kern.timecounter.choice: ACPI-fast, TSC
  • kernel: ULE+PREEMPTION, ULE

These benchmarking were tested on my laptop (IBM x31 2672-IQV, Pentium-M 1.5G with 512MB RAM), and powerd was disabled. Detail informations (dmesg, sysctl, and kernel config file) will post later.

The commands are:

for i in 1 2 3 4 5; do super-smack select-key.smack 10 1000 | grep select_index; done
for i in 1 2 3 4 5; do super-smack update-select.smack 10 1000 | grep select_index; done

mysql-linuxthreads-libpthread-acpifast-ule+pre.txt

select_index    20000   0       0       14097.47
select_index    20000   0       0       13741.43
select_index    20000   1       0       13704.01
select_index    20000   0       0       13626.05
select_index    20000   0       0       13769.32
select_index    10000   2       0       1891.63
select_index    10000   2       0       1758.65
select_index    10000   2       0       1836.00
select_index    10000   4       0       2058.71
select_index    10000   14      0       2050.05

Continue reading "FreeBSD 6.0 MySQL Performance"

Yahoo! 買下 del.icio.us

快三點半的時候 在 BBS 上丟 msg 過來:

 1594 12/10 03:24 收到           !!!!!!
 1595 12/10 03:24 收到            買了 !

如標題所說的:()

We're proud to announce that del.icio.us has joined the Yahoo! family.

不過更兇暴的是:

(We're also excited to be joining our fraternal twin Flickr!)

(開始幻想 + 的結合...)

FreeBSD 6.0 MySQL Performance Tuning

這是 目前的討論:new benchmarks. WAS: FreeBSD MySQL still WAY slower than Linux

測試的環境是在本機上跑,主要的測試對象是 Thread Library,包括了:

  • libpthread (Default)
  • libpthread + LIBPTHREAD_PROCESS_SCOPE=yes
  • libthr
  • linuxthreads
  • linuxthreads (query cache disable)
  • libthr (query cache disable)
  • libthr (TCP socket)
  • linuxthreads (TCP socket)

這幾個測試結果沒有什麼意外,速度最快的是 libthr (即 1:1 Threading)。

另外因為上面的測試環境是打開 HTT 的情況下測出來的,所以有人建議關掉 HTT,而作者也再跑了一次,發現除了 libthr 快了一點點 (大約 2%) 以外,其他的都沒差。

再來是有人提出 上的 gettimeofday() 非常花資源 (這點在 提供的 mysql ktrace log 裡面有說到),所以有人有建議修改 kern.timecounter.hardware (從 ACPI-fast 改成 TSC),不過作者好像還沒看到 :p

再來是 kernel config file 裡面好像沒有用 SCHED_ULE

這個討論串還在跑,所以還可以看一看長輩們到底有什麼花樣可以玩...

Update:開新的討論串在討論了:mysql benchmarks。另外 super-smack 這個程式是 Sasha Pachev 發展的,後來 接手 (),現在是 在維護 ()。

Gmail 所使用的防毒軟體

雖然 不願意透露 是使用哪套防毒軟體,有人還是利用邪惡的方法 (把病毒丟進去看看有哪些被抓出來,然後再跟已知軟體的列表比較) 找出來了, 使用 Which Software Scans Gmail's Attachments?Gmail AntiVirus = Sophos

測試的報告在 這裡這裡,與 Sophos 完全符合。

我本來以為 會自己搞 (因為我覺得 的量太大,傳統的作法可能不適合?),沒想到還是採用現有的 pattern 掃瞄 :)