美國主流虛擬主機CPU限制整理與討論





strawberrygirl
2009-04-25, 01:50 PM
約8家,都是10元美金以下的共享主機(無限流量)

我與每家聯絡後,初步整理,請往下移:

我有幾個疑問,希望至到的人可以解答?

1.什麼情況會讓cpu使用率一直飆升?
要達到25%使用率的話,什麼情況下可以達成?

2.什麼是負載平衡?
是指假設一台主機內有100個客戶,每人只分配1%CPU資源嗎?
1%CPU資源那些網站會出現無法負荷的情況?

3. 60 seconds it runs you can consume 40 of those 60 seconds
這是什麼意思?

4.我有問過限制流量的主機,他們的回答是:
* A process may only use a CPU at 100% for 6 seonds
* A process may use a maximum of 12 mb of RAM
* A maximum of 12 process to be run at any 1 time
發生上述情況會出現500伺服器錯誤,6秒內恢復運作。

請問有限制流量和不限制流量的主機商,那種規定對一般人的福利是比較好的?

根據:A maximum of 12 process to be run at any 1 time
是不是說?如果我的blog或網站等,同一時間點(同一秒)有12人同時點閱時,網站就會暫時掛掉?

謝謝:lovely:

http://www.hostgator.com/

諮詢後:24% of the maximum
深入對談後

a) Use 25% or more of system resources for longer then 90 seconds. There are numerous activities that could cause such problems; these include: CGI scripts, FTP, PHP, HTTP, etc.
b) Run stand-alone, unattended server-side processes at any point in time on the server. This includes any and all daemons, such as IRCD.
c) Run any type of web spider or indexer (including Google Cash / AdSpy) on shared servers.

會不會像有些沒天良主機商,無預警直接關閉網站:
Depends on the circumstances.
接著那一段對話,不小心遺失了,大概內容是:
除非佔用資源的時間一直持續,如果只是偶發是不會關站的

===

http://www.globat.com

We have 2 primary bandwidth providers, fully load balanced, to ensure that we are always connected to the Internet. offers a stable, redundant hosting environment built on state-of-the-art technologies.

Our CPU speed varies from 2.4GHz to 3.2GHz.

@@完全不限制,但是負載平衡什麼???


===

http://www.bluehost.com/

Every 60 seconds it runs you can consume 40 of those 60 seconds

?:eye: 這是什麼呢?



===

http://www.hostmonster.com/

it runs in increments of 60 seconds you can consume 40 of the 60

===

http://www.webhostingpad.com/

10 percent CPU usage

問到最低的一家

===

http://www.hostican.com/

We allow up to 25% of CPU resources within 60 seconds

===

http://www.ipower.com

We do not have a CPU limit per user basis. However, if our monitoring team finds a particular site taking up heavy system resources for prolonged period, the causing site will be suspended temporarily.

進一步問被暫停網站後怎麼恢復運作?

You need to contact us to unsuspend your account.



===

http://www.startlogic.com

Our platform consists of load balanced servers. Hence, there is no such limit in CPU.

我請他解釋什麼是負載平衡?但是還是不懂:
It means load-balanced systems include popular Web sites, large Internet Relay Chat networks, high-bandwidth File Transfer Protocol sites, NNTP servers.

===

http://www.hostexcellence.com

Due to the shared hosting nature it is not allowed to use more than 20% of the server cpu.

如果我的網站超過20%怎麼辦?
In such case you should probably search for VPS or dedicated server solution.

As if you use more than 20% of cpu with us we will have to restrict your service till further actions are not applied form your side to optimize your website to avoid any issues of such nature.

是不是會無預警關閉網站:
Yes it will be, we will restrict the access for it in order not to effect other websites been hosted on the same server.
http://www.hostexcellence.com/index.php/v2/pages.tos#q4




jedi9
2009-04-26, 05:08 PM
Load balance 負載平衡跟CPU無關,是指網路方面的負載。這是一種應用在雙線路以上的技術,可以在不同的線路之間協調頻寬,好讓每條線路能夠充分運用又不會負擔太重。

舉個例子來說,你在辦公室裡中同時申請ADSL和Cable Modem,然後買一台負載平衡的路由器(好吧,這玩意兒的確不便宜,甚至中小企業都不太愛買...)。把ADSL和Cable Modem的對內連線全都接到負載平衡器上的Wan Port,然後再從負載平衡器接到一台IP分享器。這樣辦公室所有電腦都有負載平衡啦!同時很多電腦上線的時候,就會平均分配ADSL和Cable Modem的頻寬給內部的電腦使用,就不會造成其中一條線路大爆滿,而另一條空蕩蕩沒電腦用囉。

jedi9
2009-04-29, 02:52 PM
回答您問的第一個問題:
1.什麼情況會讓cpu使用率一直飆升?
要達到25%使用率的話,什麼情況下可以達成?

A:第一家公司Hostgator其實有回答了,所有存取運算動作都會消耗CPU資源,包含CGI、PHP、Html等等不管是程式還是網頁存取都會。不過正常使用下(指的是一般網頁存取)很少會有長期平均超過10%的情況發生。(一天24小時有尖峰也有離峰期,因此平均來說要超過10%不太容易)瞬間到50%是有機會的,但真的很少。除非您網站有大量的運算且有大量的會員跟網友密集的存取。

以在下本身的經驗來說,之前管理的網站伺服器已經是老機器了(P-III 700,256MB Ram,9GB SCSI硬碟*3且採RAID 5陣列)這種規格夠老了吧?不過主機內有六個網站、兩種不同的資料庫(MySQL、DBMaker)同時運作,每個網站會有自己的電子報定時發送。平均每日不重複拜訪一共約6000~8000人次。但這種情況下CPU平均使用仍小於10%。服役超過八年現在還是跑得好好的。(比較會出問題的其實是RAM太小.....)

不過瞬間的確會有爆量的情況,最常見的就是Cronjob的一些活動(例如利用Webalizer產生每天流量報表的時候)或者發送電子報的時候。不過也鮮少超過50%。

一般網站的使用,其實CPU耗用的不太多,一個網友做了一次點擊動作,只有「一瞬間」會消耗到CPU資源(除非那個動作會引發很複雜的程式運算),因此只要您沒有寫太耗資源的程式、沒有需要長時間連線的上傳下載大檔案、沒有放大量的線上影片,一般的論壇或者部落格很少有長期佔用CPU達到25%以上啦。因為網友正常來說不會「瞬間一直點來點去」,點擊之後、頁面出來後通常會開始閱讀頁面的文字內容,這時候通常是不太佔資源的。

當然如果有人惡意用程式不斷意圖跟你的網站建立大量的HTTP連線,那就會超過負載啦。這種情況因為不是正常使用,就不算在內了。