Apr 23 2009

Notes on Wilderness #2

“To find God you must leave man and go into the creation.” says the mystic. “The works of man are tainted with  the sin of man and only by leaving them behind can you commune with your creator. All of mans institutions are sin; his culture, his governments, his cities and his religion–all sin, all corruption. For the more man builds upon his own works the further he is from God, from truth. The more grand his deeds, the more corrupt,  the more sinful.” or so said the Mystic before the Puritan nailed him to a cross.


Apr 11 2009

Solitude — from Refuge

I know the solitude my mother speaks of. It is what sustains me and protects me from my mind. It renders me fully present. I am desert. I am mountains. I am Great Salt Lake. There are other languages being spoken by wind, water, and wings. There are other lives to consider: avocets, stilts, and stones. Peace is the perspective found in patterns. When I see ring-billed gulls picking the flesh of decaying carp, I am less afraid of death. We are no more and no less than the life that surrounds us. My fears surface in my isolation. My serenity surfaces in my solitude.

Terry Tempest Williams

This bit is from Refuge. A story about a the author and her relationship to her dieing mother and their families multi-generation relationship to the The Bear River Migratory Bird Refuge. The key phrase here, the one that so far best sumarize the book and speak most to myself is “Peace is the perspective found in patterns.” She plays this very well through the book, the water levels of the great salt lake start every chapter, the success and encroachments of the brid refuge, the quality of her mothers health as she under goes chemo, her own ability to deal with each of these fluctuations in her reality. But there is something more there, the statement pin points an underlying true in our own psyches, in fact to some degree I believe in all reality. I’ll leave it to you to figure what I mean by that, or you can just assume I’m nuts. The later of course just proves the point.


Apr 6 2009

A Befitting Death

While showering tonight and feeling the pains of the of an 11 mile hike with 20 extra pounds in my back pack and the  25 extra pounds on my stomach that men my age often carry, something occurred to me, “I’m almost 40. I’m old.  This kind of  hiking hurts!”

Continue reading


Apr 2 2009

Django on Joyent

So unlike Rails deploying on Django on Joyent with default configs pretty much just sucks.  I’ve found if I just push stuff up the server hangs up, core dumps, basically it’s just a really awful experience.  Others I know have had the same problems so I thought I post what I’ve found. If you know of  anything else to make things kick please comment and I’ll add to the post.

Doing the below took me from 1 request a second and regular core dumps to about 15 request per second on a 256 meg accelerator. Satisfactory for a $200 a year host.

The worker mpm isn’t compiled in so you have to use prefork ( SUCK! ). If do something like use <IfModuel worker.c> instead of just working with what you’ve got or don’t modify the mpm.conf joyent set up for you you’ll get the default values which will totally hose your server. You can’t even serve static sites with their defaults without swapping.  Also tweek these values to your needs, the App this is for eats alot of RAM, has 15 modules and 60+ classes. You could prolly get away with 5 -10 on ServerLimit and MaxClients just have to watch prtstat -Z and /root/bin/jinfo -m while running ab tests and tune to your needs.

<IfModule prefork.c>
StartServers 4
MinSpareServers 2
MaxSpareServers 2
ServerLimit 5
MaxClients 5
MaxRequestsPerChild 0
ListenBacklog 100
</IfModule>

### deflate.conf

# this is defaulted to 9 which is stupid. Lets not spend 50ms compressing output
DeflateCompressionLevel 5

### Kill these processes. Webmin is for losers who should stick to windows or go back to kindergarden and the other two are imap processes that are just creating a security vulnerability and eating resources why any of them are enabled by default is beyond me.

svcadm disable imap
svcadm disable webmin
svcadm disable authlib

### settings.py

DEBUG = False
TEMPLATE_DEBUG = False

# I’m only working in english for this site
USE_I18N = False

# if you have gzip middleware in place get rid of it. ( this really makes a difference ) mod_deflate is already in place so you’re trying to gzip a gzipped stream… ( if you core dumping apache this is probably why ) C is faster than python by and order of magnitude so lets  just use mod_deflate.

‘django.middleware.gzip.GZipMiddleware’, # delete this

# Template context processors

these should go bye bye

“django.core.context_processors.debug”,
“django.core.context_processors.i18n”,
“django.core.context_processors.media”,

## listenIPs.conf
## virtualHost IP’s

#replace * with the actual IP address also do this if you have virtualhosts… so the vhost is isn’t listening on *:80

Listen 0.0.0.0:80
Listen 0.0.0.0:443

## Stuff you prolly already do anyway as it’s pretty standard. Cause we don’t want django handling requests for static files

# actually if you can put your images, css, and js in a separate virtualhost all together you’ll prolly get even better performance.

<!Location “/static”>

SetHandler None

</Location>

<!Location “/media”>

SetHandler None

</Location>

<LocationMatch “\.(jpg|gif|png|css|swf|doc|js|pdf)$”>

SetHandler None

</LocationMatch>

## expires.conf

# add png, css, js, jpg, etc… to expires.conf the access plus value is up to you … more stable the site longer it should be
# this won’t help an ab score but it sure helps the end user

ExpiresByType application/x-javascript “access plus 10 days”
ExpiresByType image/png “access plus 10 days”
ExpiresByType image/jpeg “access plus 10 days”
ExpiresByType text/css “access plus 10 days”
ExpiresByType application/x-shockwave-flash “access plus 10 days