Dariusz Cieślak's Blog on Software

31/01/2010

Does Your VPS Need A Dedicated IP Address? No!

Filed under: en — Tags: , , , — dariusz.cieslak @

6I believed dedicated server / VPS (Virtual Private Server) always requires dedicated IP adress. Until today.

I found (thanks, LowEndBox) interesting option where you can build your VPS totally custom parameters including shared IP address.How can it work? With shared IP? Youre joking! – you may ask. It works.

TOCICI offers “Nginx Accelerated Shared IP” wchich mean:

  • Your VPS will be hidden behind NAT like typical workstation
  • External Ngnix HTTP server will redirect HTTP traffic to your box based on URL domain
  • You can define custom ports to be forwarded to your box (SSH incoming traffic)

Pros:

  • Very cheap option (no cost of dedicated IP required, you can start VPS from 1-2 USD)
  • Security (by default no ports visible to external world)

Cons:

  • Standard ports except 80 (HTTP) unavailable: no DNS services
  • No HTTPS available (requires separate IP)
  • SSH login requires custom port (your local network may block high ports to prevent P2P)

The service fills gap between shared hosting and classic VPS. The only problem from my point of view is the distance between Europe and Portland, Oregon in the USA. 220 ms from Warsaw.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

30/01/2010

Simplest Linux Administrator Measure/Notification Toolset

Filed under: en — Tags: , — dariusz.cieslak @

It’s very important to know about server problems before they have impart on overall system performance and stability. Typical problem with server that may occur:

  • missing disk space
  • high server load (caused by CPU/IO)

In past I had problems with web applications failing to operate because lack of free disk space used for session storage. From this time I used to install monitoring on every resource that may be a problem for system.

The easiest way (Keep It Simple Stupid) to be monitored is to redirect email from root@localhost and install checks on root’s crontab. Output written to stdout/stderr (if present) is send to crontab owner after script execution. Our srcipts will only generate output when problem is found. For example:

Notify high (>4) load on server:

*/5 * * * *  cat /proc/loadavg | awk '$2 > 4 { print "High 5-minute load", $2 }'

Notify when used disk space is above 90%:

00 21 * * *  df | awk '/^\// && $5 > 90 { print $0 }'

Many additional checks could be configured that way.

In addition I used to install munin. It produces graphs that shows various resources levels (day, week, month and year perspective). You can see in one place your overall system. It’s sample graph showing month VPS instance load:

load

Do you have similar tools to monitor your server performance?

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

26/01/2010

Pytanie za 10 punktów: kiedy Onet.pl “śpi”?

Filed under: pl — Tags: — dariusz.cieslak @

Pytanie nie jest wbrew pozorom takie głupie jak się może wydawać. Serwisy WWW działają w trybie 24/7, dzięki czemu my (jako odbiorcy usług) nie musimy dopasowywać się do narzuconego z góry harmonogramu dostępności usługi (jak np. w urzędach). Ograniczenia dostępności usług wynikają z ograniczeń podsystemów je realizujących. W przypadku urzędu  jest to człowiek, którego praca jest regulowana przez kodeks pracy i wewnętrzny regulamin. W przypadku usługi WWW ograniczeniem są niezbędne operacje administracyjne jak np. backup bazy danych.

Obserwując statystyki działania usług WWW można zaobserwować pewne schematy zachowania czasu odpowiedzi systemu które mogą wynikać z:

  • aktualnej liczby użytkowników serwisu (która się zmienia w ciągu doby)
  • chwilowego obciążenia maszyn realizującej usługę (skorelowane z liczbą użytkowników)
  • czynników leżących poza serwerem jak np. obciążenie sieci
  • regularnych automatycznych operacji administracyjnych (tzw. okno serwisowe)

Wykres pomiaru czasu odpowiedzi strony http://onet.pl za 8 dni wskazuje na ten ostatni czynnik:

4

Podpowiedź do pytania z tematu postu podkreśliłem na czerwono. Onet.pl wykonuje automatycznie jakiś proces który pomiędzy 5:00 a 5:15 odłącza mechanizm generujący stronę WWW. 15 minut to czas kiedy serwis może sobie raz na dobę “odpocząć”. Kondycja godna pozazdroszczenia :-)

site-uptime.net jest usługą która pozwala ocenić jakość działania serwera na podstawie regularnych pomiarów czasu odpowiedzi HTTP. Problemy mogą być raportowane na wskazany adres e-mail lub SMS-em. Pozwala to na szybką reakcję w przypadku kiedy występuje problem i ocenę wydajności infrastruktury na podstawie danych historycznych.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

25/01/2010

Obsługa płatności przez DotPay w site-uptime.net

Filed under: pl — Tags: — dariusz.cieslak @

Miło mi ogłosić, że site-uptime.net (usługa monitorowania serwisów WWW) obsługuje od dziś płatności przez DotPay, co pozwala korzystać z wielu kanałów płatności dostępnych w Polsce takich jak mTransfer czy MultiTransfer.

Obsługa PayPal oczywiście nadal będzie dostępna równolegle z DotPay.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

22/01/2010

105 No buffer space available on OpenVZ VPS

Filed under: en — Tags: , — dariusz.cieslak @

OpenVZ is operating system-level virtualization technology that allows to run multiple virtual machines (with dedicated IP addresses) on one box (with shared filesystem). It’s like a dedicated server but it’s not the one. You have to overcome many limitations:

  • Limits on VSZ memory size (virtual, allocated but no necessary used) memory (dedicated servers and Xen have limits on used memory: RSS)
  • Fixed kernel with modules (no custom compilations here)
  • Limits on inodes allocated etc.

One of important limitations is limit of size of unswapped memory allocated to kernel. In this area resides tcpsndbuf.It’s summary size of buffers that are used to send data. If the value is low your download speed may be limited and sometimes you are getting error:

105 No buffer space available

You can check your limits by executing the following command:

# grep tcpsndbuf /proc/user_beancounters
tcpsndbuf  174336   1735168   1720320   2703360  2801251

Current buffer usage is 174336 bytes, limit is 1720320 bytes and limit was exceeded 2801251 times (ops!). Why send buffer is the problem here instead of receive buffer? Most of the time HTTP server is sending data – requests are much smaller than HTTP responses.

Solutions for this error:

  • Limit concurrent connections server handles
  • Check if unused connections are closed as soon as possible
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Older Posts »

Powered by WordPress