Archive for category Solaris

Damn slow Solaris 10

Ich bin heute mal wieder darüber gestolpert, dass einpaar Server ziemlich langsam von einem unserer Monitoring-Server erreichbar sind. Eigentlich nichts wildes, aber es stört zeitweise, wenn es um Latenz und Prozessanzahl geht.

root@monitor1:~$ time ssh -o GSSAPIAuthentication=yes app-node1 "uptime"
4:42pm up 227 day(s), 19:32, 1 user, load average: 0.14, 0.12, 0.15
real 0m15.878s
user 0m0.012s
sys 0m0.012s

Also habe ich etwas debugged, zuerst mal einpaar Server gleicher Bauart (SUN X4100 mit Solaris 10) getestet, nichts zu finden. Dann mal die SSH-Verbindung im Verbose-Mode angeschaut und die TCP-Connection geht auch schnell, nur bleibt der Prozess bei einer GIS… stehen und wartet dort. Mal gesucht und die falsche Einstellung im SSH-Client gefunden.


root@monitor1:~$ time ssh -o GSSAPIAuthentication=no app-node1 "uptime"
4:42pm up 227 day(s), 19:32, 1 user, load average: 0.16, 0.13, 0.15
real 0m0.714s
user 0m0.020s
sys 0m0.004s

Und hier dann der generelle Fix in der Globalen /etc/ssh/ssh_config:

root@monitor1:~$grep GSSAPIAuthentication /etc/ssh/ssh_config
GSSAPIAuthentication no

varnish under Solaris 10

So hier mal ne kleine Zusammenfassung von meinem Kampf mit Solaris 10 und varnish :)

Nach folgendem Tip funktionierte es nun endlich zwar nur 32Bit aber 64Bit wird auch noch angegriffen:
1) I patched varnish to compile on Solaris:

diff -ur lib/libvarnish/num.c varnish-2.0.3-patched/lib/libvarnish/num.c
--- lib/libvarnish/num.c Thu Feb 12 03:15:24 2009
+++ lib/libvarnish/num.c Fri Feb 13 13:24:10 2009
@@ -54,7 +54,7 @@
return (err_miss_num);

fval = strtod(p, &end);
- if (end == p || !isfinite(fval))
+ if (end == p || !finite(fval))
return (err_invalid_num);

if (*end == '') {

--- config.h.in Fri Feb 13 16:38:45 2009
+++ config.h.in Fri Feb 13 14:25:47 2009
@@ -222,3 +222,10 @@

/* Define to `unsigned int' if does not define. */
/* #undef size_t */
+
+# ifndef NAN
+# define NAN (0.0/0.0)
+# endif
+
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */

2) compiled and installed varnish
export PATH=$PATH:/usr/ccs/bin
VCC_CC="gcc -fPIC -O2 -shared -o %o %s" ./configure --prefix=/usr/varnish
make
make install

3) started varnish

/usr/varnish/sbin/varnishd -a 0.0.0.0:9999 -f myapp.vcl -T 0.0.0.0:9998 -t 300 -s malloc,2G

Ist zwar voll der Scheiß, da dieser Patch für 2.0.2 und 2.0.3 ist und es nun schon 2.0.5 gibt aber was solls wenns läuft :) ist mein Chef zufrieden.

Solaris ZFS replacement

Ich hatte gestern 15 Minuten zeit ein Szenario zu testen die wir alle kennen, man trinkt seinen Kaffee und ahnt nix bösen und dann *PING* Nagios Fehlermeldung HDD in einem der aller … aller wichtigsten Webserver auf Gottes Erden. Was tun? Erstmal einen schluck Kaffee sonst wird der ja kalt, aber dann auf den Server verbinden und die Lage sondieren.

Wie testet man so etwas? Relativ einfach man geht zu dem Server und zieht eine HDD raus :) wenn man sich Glücklich schätzen kann hat man ZFS, was die Reperatur erheblich erleichtert, nach dem ziehen der Platte sieht es so aus:

chong-bash$zpool status
pool: Volume
state: ONLINE
status: One or more devices has experienced an unrecoverable error. An
attempt was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using 'zpool clear' or replace the device with 'zpool replace'.
see: http://www.sun.com/msg/ZFS-8000-9P
scrub: resilver completed after 0h7m with 0 errors on Thu Oct 22 11:14:41 2009
config:
NAME STATE READ WRITE CKSUM
Volume ONLINE 0 0 0
mirror ONLINE 0 0 0
c0t2d0s0 ONLINE 0 0 0
c0t3d0s0 ONLINE 1 1.49K 0
errors: No known data errors

Nach einer kurzen Weile:

chong-bash$zpool status
pool: Volume
state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
repaired.
scrub: resilver completed after 0h7m with 0 errors on Thu Oct 22 11:14:41 2009
config:
NAME STATE READ WRITE CKSUM
Volume DEGRADED 0 0 0
mirror DEGRADED 0 0 0
c0t2d0s0 ONLINE 0 0 0
c0t3d0s0 FAULTED 0 0 0 too many errors
errors: No known data errors

Jetzt gehen wir hin und entfernen die HDD erstmal aus dem Raidset:

chong-bash$zpool detach Volume c0t3d0s0
chong-bash$zpool status
pool: Volume
state: ONLINE
scrub: resilver completed after 0h7m with 0 errors on Thu Oct 22 11:14:41 2009
config:
NAME STATE READ WRITE CKSUM
Volume ONLINE 0 0 0
c0t2d0s0 ONLINE 0 0 0
errors: No known data errors

Jetzt tauschen wir die HDD und partitionieren die neue HDD so wie die Alte:

chong-bash$prtvtoc /dev/rdsk/c0t2d0s2 | fmthard -s - /dev/rdsk/c0t3d0s2
fmthard: New volume table of contents now in place.

Und wir können die Platte wieder einfügen:

chong-bash$zpool attach Volume c0t2d0s0 c0t3d0s0
chong-bash$zpool status
pool: Volume
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 0.53% done, 0h9m to go
config:
NAME STATE READ WRITE CKSUM
Volume ONLINE 0 0 0
mirror ONLINE 0 0 0
c0t2d0s0 ONLINE 0 0 0
c0t3d0s0 ONLINE 0 0 0
errors: No known data errors

Es dauert natürlich einen moment bis das resilvering komplett ist aber dann sind wir wieder gut dabei :D

Tags: ,