Welcome to janforman.com you can find here infos about downtime of my servers and other stuff.

Content Delivery Network

Today i was testing simple content delivery network (CDN). it’s implemented on high-level in application layer and uses reverse proxy (with temporary storage). Network ranges are cached in main database and selected while request is being processed.
Schema is very easy and there’s no exact limitation about number of users and nodes.

Imagehosting Maintenance

Scheduled Maintenance 02/1/2009 from 1:00-03:00 CET
You may not connect or can have problems with loading images :-) thank you for your patience.
ORION.janforman.com virtual server may be down for some time.

Server friendly grub.conf

There are two kernels (bzImage and bzSafe), bzImage is experimental one and bzSafe is default.
Copy your testing kernel to bzImage and run # grub-set-default 1
After rebooting your new kernel is trying to boot, if anything goes wrong bzSafe is selected after new reboot.
If you like new kernel, simply copy bzImage to bzSafe …

– This is very friendly grub.conf for server –

default saved
timeout 1
fallback 0

title=Kernel Safe
root (hd0,1)
kernel /boot/bzSafe root=/dev/hda2
savedefault

title=Kernel Experimental
root(hd0,1)
kernel /boot/bzImage root=/dev/hda2
savedefault 0

– This is very friendly grub.conf for server –
Change (hd0,1) and root=/dev/hda2 to suit your system configuration, have fun ;-)

Linux Network Tuning

Server oriented optimalization. Be careful this is not 100% RFC compatible, but working nice on my servers

echo “32767″ >/proc/sys/net/ipv4/tcp_max_tw_buckets_ub
echo “1024 65000″ >/proc/sys/net/ipv4/ip_local_port_range
echo “250 32000 100 128″ >/proc/sys/kernel/sem
echo “65536″ >/proc/sys/net/ipv4/tcp_max_orphans
echo “4096 87380 16777216″ >/proc/sys/net/ipv4/tcp_rmem
echo “4096 65536 16777216″ >/proc/sys/net/ipv4/tcp_wmem
echo “16777216″ >/proc/sys/net/core/rmem_max
echo “16777216″ >/proc/sys/net/core/wmem_max
echo “262144″ >/proc/sys/net/core/netdev_max_backlog
echo “15″>/proc/sys/net/ipv4/tcp_fin_timeout
echo “1″ >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo “1″ >/proc/sys/net/ipv4/icmp_echo_ignore_all
echo “1″ >/proc/sys/net/ipv4/
icmp_ignore_bogus_error_responses
echo “1″ >/proc/sys/net/ipv4/ip_no_pmtu_disc
echo “0″ >/proc/sys/net/ipv4/tcp_rfc1337
echo “1″ >/proc/sys/net/ipv4/tcp_orphan_retries
echo “1″ >/proc/sys/net/ipv4/tcp_tw_recycle
echo “1″ >/proc/sys/net/ipv4/tcp_tw_reuse
echo “10″>/proc/sys/net/ipv4/tcp_keepalive_intvl
echo “2″ >/proc/sys/net/ipv4/tcp_keepalive_probes
echo “0″ >/proc/sys/net/ipv4/tcp_sack
echo “0″ >/proc/sys/net/ipv4/tcp_timestamps
echo “0″ >/proc/sys/net/ipv4/tcp_window_scaling
echo “30″>/proc/sys/net/ipv4/tcp_keepalive_time
echo “65536″ >/proc/sys/fs/file-max
ulimit -n 65536
ifconfig eth0 txqueuelen 2000
ifconfig eth0 mtu 1400

// lower MTU for some connections, possible values are
// 1400 (safe), 1436, 1492
// 9000 for 1GBit connections (for less interrupts per second :-)

Redirect port to internal network

DNAT and SNAT settings if you need diferent default gateway in network (I Know… Little Slower)

# Flush NAT rulez
iptables -t nat -F

# Set DNAT and accept it only from PUBLICCLIENTIP at WANPORT
iptables -t nat -A PREROUTING --src PUBLICCLIENTIP --dst PUBLICROUTERIP -p tcp --dport WANPORT -j DNAT --to-destination LANIP:LANPORT

# Set SNAT for port LANIP/LANPORT
iptables -t nat -A POSTROUTING -p tcp --dst LANIP --dport LANPORT -j SNAT --to-source LANROUTERIP

— There are 2x NATs (Source,Destination) in this example, but in most cases you need this, because server on LAN IP must send data to internal IP of the router (not to default gw).