<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8339019936960713266</id><updated>2026-03-16T04:18:13.703-07:00</updated><category term="IPv6 IPv4 Mapped addresses linux solaris nginx ejabberd"/><category term="IPv6 smooth transition asymmetric network administrator whynot"/><category term="NFS UDP"/><category term="babble"/><title type='text'>imoverclocked</title><subtitle type='html'>fast ramblings of a mostly technical nature.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-6380518728922302684</id><published>2025-07-18T20:36:00.001-07:00</published><updated>2025-07-18T20:36:34.922-07:00</updated><title type='text'>How Reordering Files Reduced My Archive Size by Half</title><content type='html'>&lt;h2 style=&quot;text-align: left;&quot;&gt;Background&lt;/h2&gt;&lt;p&gt;I have a solar inverter made by &lt;a href=&quot;http://fronius.com&quot;&gt;Fronius&lt;/a&gt; that uploads json to an ftp server every ten seconds. There are two different json files (*.powerflow and *.interverter) with slightly different information. Every day, this means there are about 10k files and the file sizes vary but are usually between 500-1000 bytes each. On the local filesystem that equates to about 40MB per day. Over a year, we are talking about 3-4 million files (14-15GB) which can exhaust inodes on a reasonably sized ext4 filesystem far before space is a concern.&lt;/p&gt;&lt;p&gt;To manage this, I roll stats up daily. The stats are published into a folder named via YYYYMMDD by the inverter and I slurp those up into InfluxDB and then create a compressed tar archive called YYYMMDD.tar.xz for an ultimate backup.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;This is a good system and each year compresses into around 50-100 MB. Already, we see that we are 1000x better in terms of space and inode usage. Maybe we can do better?&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Example File Listing&lt;/h2&gt;&lt;blockquote&gt;&lt;div&gt;/anon-ftp/fronius/photosynth/processed/20250717# ls -la | head&lt;br /&gt;total 40540&lt;br /&gt;drwxr-xr-x &amp;nbsp;2 root root 512000 Jul 18 08:05 .&lt;br /&gt;drwxr-xr-x 10 root root &amp;nbsp;40960 Jul 19 01:35 ..&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 738 Jul 17 17:14 100450.solarapi.v1.inverter&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 802 Jul 17 17:14 100450.solarapi.v1.powerflow&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 738 Jul 17 17:14 100500.solarapi.v1.inverter&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 802 Jul 17 17:14 100500.solarapi.v1.powerflow&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 738 Jul 17 17:15 100510.solarapi.v1.inverter&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 802 Jul 17 17:15 100510.solarapi.v1.powerflow&lt;br /&gt;-rw------- &amp;nbsp;1 ftp &amp;nbsp;ftp &amp;nbsp; &amp;nbsp; 738 Jul 17 17:15 100520.solarapi.v1.inverter&lt;br /&gt;...&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;When we do the obvious tar invocation, the files are added in a somewhat random order.&lt;/p&gt;&lt;blockquote&gt;# tar -cJvf  20250717-obvious.tar.xz 20250717/ | head&lt;br /&gt;20250717/&lt;br /&gt;20250717/152720.solarapi.v1.inverter&lt;br /&gt;20250717/193700.solarapi.v1.inverter&lt;br /&gt;20250717/154110.solarapi.v1.powerflow&lt;br /&gt;20250717/163020.solarapi.v1.inverter&lt;br /&gt;20250717/230850.solarapi.v1.inverter&lt;br /&gt;20250717/130120.solarapi.v1.inverter&lt;br /&gt;20250717/102720.solarapi.v1.inverter&lt;br /&gt;20250717/213220.solarapi.v1.powerflow&lt;br /&gt;20250717/110950.solarapi.v1.inverter&lt;br /&gt;...&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;text-align: left;&quot;&gt;and we are left with the resulting tar.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Does ordering the files make a difference?&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Based on how compression technology works, it makes sense (in my head) that similar content right next to each other would be compressed better than mixed content. If I do a simple experiment, maybe I can validate this and see how much of an effect it has.&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style=&quot;text-align: left;&quot;&gt;# tar -cJf 20250717-manual-sort.tar.xz 20250717/*.powerflow 20250717/*.inverter&lt;br /&gt;# du -c *.tar.xz&lt;br /&gt;116&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;20250717-manual-sort.tar.xz&lt;br /&gt;212&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;20250717.tar.xz&lt;/div&gt;&lt;/blockquote&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Holy smokes! With almost no work, we are using about 54% of the space of the original tar invocation! (Yes, I did validate that both produce the same directory structure/content with diff -r)&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Can I apply this anywhere?&amp;nbsp;&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;I decided to download a dataset with lots of files. The easiest to think of was a linux kernel tarball for 6.16-rc6 which has 89,677 files and unpacks to 1.7G on my local filesystem. To order files here, I needed to write a utility since I couldn&#39;t do as simple of a tar invocation as I did for my stats collection.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;The script:&amp;nbsp;&lt;a href=&quot;https://github.com/imoverclocked/orderfs&quot;&gt;https://github.com/imoverclocked/orderfs&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;I played around with different orderings and binning based on sizes. As it turns out, the linux kernel source is structured in a way that is pretty optimal already:&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;# du -h *.tar.gz&lt;/div&gt;&lt;div&gt;241M&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;linux-6.16-rc6.recompress.tar.gz&lt;/div&gt;&lt;div&gt;249M&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;linux-6.16-rc6.sorted-bins.tar.gz&lt;/div&gt;&lt;div&gt;264M&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;linux-6.16-rc6.sorted.tar.gz&lt;/div&gt;&lt;div&gt;241M&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;linux-6.16-rc6.tar.gz&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;The variants above:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;recompress - uncompressed the original tar and then recompress locally with vanilla gzip&lt;/li&gt;&lt;li&gt;sorted - apply a rough sort with filetype based on extension and then by size&lt;/li&gt;&lt;li&gt;sorted-bins - apply an extension-sort and prefer to keep smaller files sorted by path&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: left;&quot;&gt;The vanilla recompression was within a couple hundred bytes so my gzip is slightly different from the one kernel org is using. Maybe they use --best or some other flag that I didn&#39;t bother with.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Sorting by extension and then putting files in ascending size actually made things worse. I suspect (SWAG) that the pathnames in random order made it harder for gzip to find larger common chunks in the tar headers.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Sorting by extension and then by path made things better but still not as good as the default directory structure. (Well done kernel folks!)&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Summary&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;While not extensively tested, the script does provide a definite win for my local stats in terms of percentages. The technique already seems to be used by the kernel.org structure, which is cool. Maybe others can use the script to see if restructuring their archives makes a significant difference for them.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/6380518728922302684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2025/07/how-reordering-files-reduced-my-archive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/6380518728922302684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/6380518728922302684'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2025/07/how-reordering-files-reduced-my-archive.html' title='How Reordering Files Reduced My Archive Size by Half'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-4978806235521632332</id><published>2022-05-06T07:28:00.001-07:00</published><updated>2022-05-06T07:33:23.199-07:00</updated><title type='text'>IPv6, WiFi access point, nftables, and proxy_ndp</title><content type='html'>&lt;p&gt;&amp;nbsp;For reasons I don&#39;t care to defend, my internet connection looks something like this:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://imoverclocked.blogspot.com/2022/05/ipv6-wifi-access-point-nftables-and.html&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;vague network topology&quot; border=&quot;0&quot; data-original-height=&quot;708&quot; data-original-width=&quot;1496&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrb03BdOWlRTIKpAb8r15G6zu57hjw05qDcoXZ5H3pp6zHqqpdlXrPriNz0wsiVQz009vGrr4-YBpOOvLR7JCpoisYHSrSMQ2a3q6h10E5aHYd8KZPo_izQ0Gp_HvXXpt0CCtuhnsZ_IxX91OiZP1rfxjPKtWu-zZBcrKlYvWxbksrucsZoRwGw-Pe/w640-h302/Internet%20Setup.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Since my firewall is connected to the hotspot via WiFi, bridging to my internal network is &lt;a href=&quot;https://unix.stackexchange.com/questions/363332/how-do-i-configure-a-network-interface-bridge-from-wifi-to-ethernet-with-debian&quot;&gt;out of the question&lt;/a&gt;. While there are many tutorials and approaches to getting IPv6 into a topology that looks like this, none of them work for me for various reasons. eg: the hotspot will not delegate a prefix via dhcpv6&lt;/p&gt;&lt;p&gt;I really want IPv6 so ... let&#39;s see what we can do!&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;proxy_ndp&lt;/h2&gt;&lt;p&gt;First of all, we need to fool the hotspot into thinking that the Linux WiFi link has a bunch of addresses that actually belong to other computers behind it. IPv6 uses neighbor discover protocol (ndp) and the linux kernel provides a feature called proxy_ndp. When enabled and configured, it does exactly what we want!&lt;/p&gt;&lt;div&gt;I couldn&#39;t find any real automation surrounding this technology. However, it does allow my wifi interface to expose a number of IPv6 addresses that are behind the Linux firewall. Manual configuration looks something like this:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;# enable proxy_ndp on the wireless link&lt;br /&gt;sysctl -w net.ipv6.conf.wlan0.proxy_ndp=1&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;# tell the kernel to be discoverable for an IP it&lt;br /&gt;# doesn&#39;t actually have&lt;br /&gt;ip -6 neigh add proxy 2001:db8::100&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div&gt;There is a user space daemon which looks somewhat unmaintained called ndppd that I didn&#39;t have a lot of luck with. In theory, it automatically provides neighbor discovery between two network interfaces. We&#39;ll bridge that gap in a bit.&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;radvd&lt;/h2&gt;&lt;div&gt;For our second step, we need to configure the nodes on the internal network to use the same prefix as we are getting from the hotspot. This is going to make routing a little fun but we&#39;ll get back to that in a moment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a lot of things which will advertise routes for you. For example, dnsmasq can do it. I&#39;m going to use radvd since that&#39;s all it does. Feel free to get fancy with something else here.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;# Find the current prefix for wlan0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ip -6 route show dev wlan0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;(for illustration, maybe it shows&amp;nbsp;&lt;i style=&quot;caret-color: rgb(32, 33, 34); color: #202122; font-size: 14px;&quot;&gt;2001:db8::/64)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;# install/configure radvd&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;apt install radvd&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;vi /etc/radvd.conf&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;systemctl start radvd&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;sample radvd.conf:&lt;/h3&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#&amp;nbsp;eth0 is the internal network interface&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;interface eth0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;AdvSendAdvert on;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;AdvDefaultPreference low;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;AdvHomeAgentFlag off;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; # Auto-configured prefix from wlan0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; prefix 2001:db8::/64&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AdvOnLink on;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AdvAutonomous on;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AdvAutonomous on;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;more-specific routes&lt;/h2&gt;&lt;div&gt;For our next step, we need to get the linux firewall to pass packets in the right directions. Since we only have a single IPv6 /64 prefix to work with, our default route and prefix is configured on the WiFi link while the internal network nodes are also provisioned on our internal link. This means we need a bunch of specific routes. Manual configuration looks something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;# Add a specific route for 2001:db8::100 to the internal network&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ip -6 route add 2001:db8::100 dev eth0&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;nftables&lt;/h2&gt;&lt;div&gt;Next, we need to get the kernel to actually forward packets. Let&#39;s use some firewall rules (these are quite loose, you&#39;ll probably want to tighten them up for your needs) and get our internal network online.&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;example /etc/nftables.conf:&lt;/h3&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;define DEV_INTERNAL = eth0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;define DEV_INTERNET = wlan0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;define V6_PREFIX = { 2001:db8::/64 }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;table inet filter {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; chain forward {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;type filter hook forward priority 0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;policy drop;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp; # stateless acceptance of all traffic to/from the&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp; #&amp;nbsp;&lt;/span&gt;&lt;/span&gt;internal network on the configured prefix&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;ip6 saddr $V6_PREFIX&amp;nbsp;iifname $DEV_INTERNAL accept;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;ip6 daddr $V6_PREFIX&amp;nbsp;oifname $DEV_INTERNAL accept;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp; # these can help with debugging&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;ip6 saddr $V6_PREFIX&amp;nbsp;log prefix &quot;filter-forward (s) &quot; drop;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;ip6 daddr $V6_PREFIX&amp;nbsp;log prefix &quot;filter-forward (d) &quot; drop;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;log prefix &quot;inet-forward (dropped) &quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will also need to enable forwarding and the nftables service for this.&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#&amp;nbsp;Enable ipv6 forwarding for all interfaces&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;sysctl -w&amp;nbsp;net.ipv6.conf.all.forwarding=1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#&amp;nbsp;reload firewall rules&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;systemctl restart nftables&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Adding more nodes&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;At this point, only one node (2001:db8::/64) is online. It would be annoying to add each node manually, so we&#39;ll grab connection attempts and turn those into the requisite commands to run.&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;example nftables.conf:&lt;/span&gt;&lt;/h3&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;define DEV_VETH veth0&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;table netdev v6traffic {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;chain ingress-internal {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;type filter hook ingress device $DEV_INTERNAL priority 0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;ip6 saddr $V6_PREFIX tcp flags syn dup to $DEV_VETH;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;example /etc/network/interfaces.d/veth0:&lt;/h3&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;auto veth0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;iface veth0 inet manual&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;pre-up ip link add veth0 type veth peer veth1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;pre-up ip link set veth1 up&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;pre-down ip link del veth0 type veth peer veth1&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;example hackish script (ymmv):&lt;/h3&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;tcpdump --immediate-mode -i veth1 &#39;ip6&#39; -l 2&amp;gt; /dev/null | \&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; awk -W interactive -F. &#39;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; /IP6/ {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; sub(/.*IP6 /, &quot;&quot;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; print &quot;ip -6 neigh add proxy &quot; $1 &quot; dev wlan0&quot;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; print &quot;ip -6 route add &quot; $1 &quot; dev eth0&quot;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; }&#39; | sh -v&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Save the above script somewhere (heck, rewrite it and make it better!) and let it run in the background. As nodes attempt to connect through the linux firewall, the nftables-dup-to-veth0 will trigger the proxy_ndp and specific route lines. There will be lots of duplication but fixing that is an exercise left to the comments :)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/4978806235521632332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2022/05/ipv6-wifi-access-point-nftables-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/4978806235521632332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/4978806235521632332'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2022/05/ipv6-wifi-access-point-nftables-and.html' title='IPv6, WiFi access point, nftables, and proxy_ndp'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrb03BdOWlRTIKpAb8r15G6zu57hjw05qDcoXZ5H3pp6zHqqpdlXrPriNz0wsiVQz009vGrr4-YBpOOvLR7JCpoisYHSrSMQ2a3q6h10E5aHYd8KZPo_izQ0Gp_HvXXpt0CCtuhnsZ_IxX91OiZP1rfxjPKtWu-zZBcrKlYvWxbksrucsZoRwGw-Pe/s72-w640-h302-c/Internet%20Setup.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-1179787025634832808</id><published>2020-10-14T19:51:00.004-07:00</published><updated>2020-10-14T21:57:50.761-07:00</updated><title type='text'>Using Telegraph to collect local PurpleAir sensor data</title><content type='html'>&lt;p&gt;If you are like me, you enjoy breathing. Perhaps you are not as keen on it but you certainly notice when it starts getting uncomfortable to breathe from heavy smoke or smog. After the latest round of California wildfires, I decided to purchase a &lt;a href=&quot;https://www2.purpleair.com&quot;&gt;PurpleAir sensor&lt;/a&gt; so I could know how the air inside my house and outside of my house were likely to affect me. I also have no central AC so understanding what happens when I open my windows turned out to be fairly transformative. I chose PurpleAir because a running friend linked me to it before coordinating a run and it has a fair network of sensors whose data is aggregated and displayed on a map for all to see. The data is also collected for WUnderground and its supporting entities. There was no node within 10 miles of my house and there are now several within 3 miles.&lt;/p&gt;&lt;p&gt;Enough backstory! Let&#39;s dive in...&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Goals:&lt;/h3&gt;&lt;p&gt;1) Understand current and historical data from my shiny new sensor&lt;/p&gt;&lt;p&gt;2) Find sources of air pollution in my home&lt;/p&gt;&lt;p&gt;3) Measure effectiveness of different filters at reducing AQI&lt;/p&gt;&lt;p&gt;I like the aggregated data on the PurpleAir website but they make it difficult to really get the most from the data. Also, they don&#39;t expose the full range of measurements on the website. While I appreciate this from a slight privacy standpoint, I need access to it for my own purposes.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;My solution:&lt;/h3&gt;&lt;p&gt;Setup &lt;a href=&quot;https://grafana.com&quot;&gt;Grafana&lt;/a&gt;, &lt;a href=&quot;https://www.influxdata.com&quot;&gt;InfluxDB&lt;/a&gt; and &lt;a href=&quot;https://www.influxdata.com/time-series-platform/telegraf/&quot;&gt;Telegraf&lt;/a&gt;&amp;nbsp;on a small local server (think: RaspberryPi or RockPro.)&lt;/p&gt;&lt;p&gt;There are many tutorials on getting these technologies set up with one-another so I&#39;ll just focus on the Telegraf configuration as well as displaying an example Grafana dashboard. It&#39;s up to you to fill in the rest!&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Telegraf config:&lt;/h4&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;[[inputs.http]]&lt;br /&gt;&amp;nbsp; interval = &quot;10s&quot;&lt;br /&gt;&amp;nbsp; urls = [&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;http://purple-outside.example.com/json?live=true&quot;&lt;br /&gt;&amp;nbsp; ]&lt;br /&gt;&amp;nbsp; method = &quot;GET&quot;&lt;br /&gt;&amp;nbsp; timeout = &quot;2s&quot;&lt;br /&gt;&amp;nbsp; data_format = &quot;json&quot;&lt;br /&gt;&amp;nbsp; name_override = &quot;purpleair&quot;&lt;br /&gt;&amp;nbsp; tag_keys = [&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;SensorId&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;Geo&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;Mem&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;place&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;version&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;hardwareversion&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;hardwarediscovered&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;wlstate&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_0&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_1&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_2&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_3&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_4&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_5&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_6&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_7&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_8&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;status_9&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &quot;ssid&quot;,&lt;br /&gt;&amp;nbsp; ]&lt;br /&gt;&amp;nbsp; ## Unclear that this does the right thing with timezones/utc as the reference&lt;br /&gt;&amp;nbsp; ## time in go is specific to MST.&lt;br /&gt;&amp;nbsp; # json_time_key = &quot;DateTime&quot;&lt;br /&gt;&amp;nbsp; # json_time_format = &quot;2006-01-02T15:04:05z&quot;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&quot;purple-outside.example.com&quot; can be replaced with your sensor&#39;s name or IP address depending on your network setup.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This configuration takes the JSON data from the sensor every 10 seconds and treats SensorID/Geo/Mem/place/etc... as tag data in InfluxDB.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Grafana dashboard AQI config:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;AQI Query&quot; border=&quot;0&quot; data-original-height=&quot;568&quot; data-original-width=&quot;1876&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyP7ieEtlMBwGa4vjVOCxs8dXxiNXuI6_AwvqfuMQlQYmPymy-zHgt33vNLhvGWhTAYO7u0x8oXAQDGMGaM1EdiIq_0A2yvX4Oi5qxhuBuEE_YvqYKJtX2CaP7OpzWvKH-QpUVOr9V_9Q/w640-h194/Purple+Air+AQI+Query.png&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;For those that like to edit queries, the textual version of this config is:&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SELECT mean(&quot;pm2.5_aqi&quot;) FROM &quot;purpleair&quot; WHERE (&quot;url&quot; = &#39;http://purple-outside.example.com/json?live=true&#39;) AND $timeFilter GROUP BY time($__interval) fill(linear)&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;If you have a fancy two-sensor version, you can add a second query with &quot;pm2.5_aqi_b&quot; instead of &quot;pm2.5_aqi&quot;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;AQI graph&lt;/h4&gt;&lt;p style=&quot;text-align: left;&quot;&gt;I purchased two sensors; One for inside and one for outside. As such, I added three queries and colored the two outside sensors as blue and the inside one as yellow. The resulting graph looks like this:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;AQI Graph&quot; border=&quot;0&quot; data-original-height=&quot;902&quot; data-original-width=&quot;1580&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR-WyMfXF0RkpBF9FyA4PlZYPeskk9d4PTPmyC8MViMR23P5pVtt0j110Kwv6O_5Cr1Lqkmq2D0tkgBm_hcEPdcxeQhRCwYezS8KFLzBJxhYJKKjzG-gAfxeFzjAFssLcGW0WkXiHgh8w/w640-h366/Purple+Air+2.5+AQI+Overlay.png&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Can you tell when the stove is being used? (Hint: it&#39;s those tall yellow peaks!)&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Temp/Humidity&lt;/h4&gt;&lt;p style=&quot;text-align: left;&quot;&gt;The sensor also exposes fine-grained counts of different particle sizes, temperature, humidity, dewpoint and &lt;a href=&quot;https://www2.purpleair.com/community/faq#hc-json-object-fields&quot;&gt;and more&lt;/a&gt;. For exa&lt;span style=&quot;font-family: inherit;&quot;&gt;mple, instead of &quot;pm2.5_aqi&quot; you can select &quot;current_dewpoint_f&quot;, &quot;current_temp_f&quot;, and &quot;current_humidity&quot; and create a dual-axis graph:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;Temperature Humidity and Dewpoint graph&quot; border=&quot;0&quot; data-original-height=&quot;898&quot; data-original-width=&quot;1574&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjKanZ6Fg0gwZ0D5iaSXK5GIDF4iASxKGvMe8qLXhtj9ao2N-MMomxbvjTd7XxVxB7pHQKBzd5SbHfSEwoMg4BaIfFYn0_I45BI3XRR6lpio0LzpHhQ-Y-rFbNk0Q_pBpYQapc6YFV6I4/w640-h366/Purple+Air+Temp+Humid.png&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Pressure&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;Pressure graph&quot; border=&quot;0&quot; data-original-height=&quot;882&quot; data-original-width=&quot;1584&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMWCbfhW-SAsBBgtbaw7PA2LEGN6DhJXXE2p5Qpho5-tSGik70ydBpKVm2hjk7RlxN3bM155mVuxZYf7KcwtyENoYgDg-zQ_PNhv9sRipbNs74KCFktZ_QugcXByggUOE9PofdMeWZrBk/w640-h356/Purple+Air+Pressure.png&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Particle Size Counts&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;898&quot; data-original-width=&quot;1590&quot; height=&quot;362&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6jtzigmg4jn20yq9YmTCcz83st847C8B7yTi-PDckLqNPEJW0fKCBHW66p436c5xyFKPhmIr6ZY4-xJWYaKBlqUBFgi5TRZEBnhMYcmlKiuGPlHYadhaTLzOn8b0Zuoy7zWMX0mGKfc/w640-h362/Purple+Air+Particle+Size+Count.png&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Results&lt;/h3&gt;&lt;div&gt;I found that one of my filters does next to nothing for my air quality while my Honeywell HEPA filter brings the AQI of my house into the single digits from triple digits after some hours of running.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, cooking without adequate ventilation releases a surprising amount of fine particulate matter (but it sure smells good!)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Final Remarks&lt;/h3&gt;&lt;div&gt;I hope this helps someone else breathe easier. Just knowing what your air quality is can be very helpful for understanding sources of congestion/sleep/wheezing etc. Thanks for reading!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/1179787025634832808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2020/10/using-telegraph-to-collect-local.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1179787025634832808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1179787025634832808'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2020/10/using-telegraph-to-collect-local.html' title='Using Telegraph to collect local PurpleAir sensor data'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyP7ieEtlMBwGa4vjVOCxs8dXxiNXuI6_AwvqfuMQlQYmPymy-zHgt33vNLhvGWhTAYO7u0x8oXAQDGMGaM1EdiIq_0A2yvX4Oi5qxhuBuEE_YvqYKJtX2CaP7OpzWvKH-QpUVOr9V_9Q/s72-w640-h194-c/Purple+Air+AQI+Query.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-8168478947180152055</id><published>2015-12-11T17:52:00.000-07:00</published><updated>2015-12-11T17:52:29.474-07:00</updated><title type='text'>For the love of bits, stop using gzip!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Everytime you download a tar.gz, Zod kills a kitten. Everytime you generate a tar.gz, well, let&#39;s keep this family-safe.&lt;br /&gt;
&lt;br /&gt;
In 2015, there should be very few reasons to generate .tar.gz files. We might as well just use .zip for all the progress we have made since 1992 when gzip was initially released. xz has been a thing since 2009, yet I still see very little adoption of the format. Today, I downloaded &lt;a href=&quot;https://www.meteor.com/&quot; target=&quot;_blank&quot;&gt;Meteor&lt;/a&gt;&amp;nbsp;and noticed that it downloads a .tar.gz. I manually downloaded the file and then recompressed it using xz:&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;$ du -h meteor-bootstrap-os.osx.x86_64.tar.* &lt;br /&gt;139M meteor-bootstrap-os.osx.x86_64.tar.gz&lt;br /&gt; 67M meteor-bootstrap-os.osx.x86_64.tar.xz&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Seriously, less than half the size! Maybe it&#39;s the amount of time is takes to compress? Let&#39;s see:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;$ cat meteor-bootstrap-os.osx.x86_64.tar | time xz -9 -c &amp;gt; /dev/null                             xz -9 -c &amp;gt; /dev/null  165.21s user 1.14s system 99% cpu 2:47.70 total&lt;br /&gt;&lt;br /&gt;$ cat meteor-bootstrap-os.osx.x86_64.tar | time gzip -9 -c &amp;gt; /dev/null &lt;br /&gt;gzip -9 -c &amp;gt; /dev/null  35.03s user 0.23s system 99% cpu 35.583 total&lt;/span&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ok, so compressing takes longer. You have to do it once. It&#39;s still on the order of reasonable for something that compiles a 600MB tarball in the first place. What about decompressing?&lt;/div&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;$ time xz -d -c meteor-bootstrap-os.osx.x86_64.tar.xz &amp;gt; /dev/null&lt;br /&gt;4.25s user 0.08s system 99% cpu 4.327 total&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;$ time gzip -d -c meteor-bootstrap-os.osx.x86_64.tar.gz &amp;gt; /dev/null &lt;br /&gt;1.35s user 0.04s system 99% cpu 1.389 total&lt;/span&gt;&lt;br /&gt;&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;... and decompressing takes a little longer. But, wait a second, how long does it take to download the file in the first place? I&#39;m on a decent connection and the file is being hosted on something that delivers the content at an average of (say) 1.5 MB/s. That&#39;s 88 seconds for the .tar.gz and 42 seconds for the tar.xz. Since the content is streamed directly to tar (a la: curl ... | tar -xf - ), we actually don&#39;t see a time slowdown because xz is slower, we see an overall &lt;i&gt;speedup&lt;/i&gt;&amp;nbsp;because the slowest operation is getting the bits in the first place!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
What about tooling?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
OSX: tar -xf some.tar.xz (WORKS!)&lt;/div&gt;
&lt;div&gt;
Linux: tar -xf some.tar.xz (WORKS!)&lt;/div&gt;
&lt;div&gt;
Windows: ? (No idea, I haven&#39;t touched the platform in a while... should WORK!)&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Why am I picking on Meteor? Well, they place the tagline&amp;nbsp;&lt;/span&gt;of &quot;Build apps that are a delight to use, faster than you ever thought possible&quot; right on their homepage. I just ran their install incantation and timed it:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;./install.sh  2.32s user 7.67s system 14% cpu 1:10.53 total&lt;/span&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
70 seconds! Nice job! I must have downloaded it slightly faster than in my initial testing. It also means that the install is extremely limited by download speeds. So ... I can easily imagine this being twice as fast. All that needs to be done is change the compression format and I should be able to install this in 33 seconds!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So, who *does* use xz? kernel.org. Also, the linux kernel itself optionally supports xz compression of initrd images. Vendors just need to pay attention and turn the flags on. Anyone else want to be part of the elite field of people who use xz? Please?&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/8168478947180152055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2015/12/for-love-of-bits-stop-using-gzip.html#comment-form' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/8168478947180152055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/8168478947180152055'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2015/12/for-love-of-bits-stop-using-gzip.html' title='For the love of bits, stop using gzip!'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-6291560479589621139</id><published>2014-07-27T21:24:00.001-07:00</published><updated>2014-07-27T21:24:52.540-07:00</updated><title type='text'>Runners Manifesto -- draft</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
It seems like the running community needs something along the lines of what the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hacker_Manifesto&quot; target=&quot;_blank&quot;&gt;Hacker Manifesto&lt;/a&gt; was meant to be, except for running. There are many articles describing running to runners but perhaps this can be a document to introduce non-runners to runners... or even a document for runners to cherish.&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
--&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;Hi, I am a runner. I may not run faster than you, but I might run a lot &lt;i&gt;further&lt;/i&gt;. Or maybe I can run more consistently every morning or evening. Or maybe I just enjoy lacing up a pair of shoes, or running barefoot.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;First, let&#39;s be clear. I don’t run away from things, I run towards them. I make goals, have dreams and connect with other runners because we have a fundamental understanding of each other. We like to run.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;Why do I run? Well, why do you breath? Running is kinda like breathing. Yeah, I could stop for a while but I would start getting light headed and dizzy… kinda like before a marathon. You really don’t want to bother me then.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;I, like so many others, used to not understand runners. In high school, I played soccer and I could run. Im college, I biked around quite a bit. It wasn’t until life forced me to discover new things that I finally found my inner runner. Once I did, I realized that running fast was fun. Running far was fun. Trying to do both was dangerous… and also fun. Ultimately, neither was fundamental to what I did on a daily basis but somehow running becomes a way of life.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;I was lucky when I started; I met a group of runners who had run a long time. There were wise old owls to give sage advice and young yet dedicated runners to keep the energy up. Just about everyone could whup my butt except I found that it didn’t matter. We were all friends and supported each other in our goals. Were we running the same race? Cool! Let’s get together and keep each other motivated to do better. Running similar races? Awesome … let’s get together and help keep each other motivated. Completely different races? Let’s get together and keep each other motivated. Essentially, I walked into what was a hidden community that hides in plain sight and supports itself.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;What defines a runner? For me, its someone who gets out there and pushes themselves to achieve their goals. It may start with running and seeing a 5k to accomplish, and then trying to beat their 5k time. Maybe it takes you twice as long to do a 5k as me, that means you are working for twice as long to do that and I respect that. Maybe you respect that I can do it twice as fast. Either way, you rock for doing it.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;If you stop running, are you still a runner? Yeah, I think so. Running is a way of life, not an activity you do. I’ve met people who used to run and I can tell they are runners. They say they used to be runners but I know better. They still run, just not on their feet.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;If you are a non-runner, that’s cool too. Please don’t ask why I run and I won’t ask why you don’t. Also, if you want to challenge me to a race, that’s awesome. Come and train with me and we’ll run whatever I’ve signed up for next.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;See you out there!&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/6291560479589621139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2014/07/runners-manifesto-draft.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/6291560479589621139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/6291560479589621139'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2014/07/runners-manifesto-draft.html' title='Runners Manifesto -- draft'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-2048395067560876480</id><published>2014-03-19T15:32:00.000-07:00</published><updated>2014-03-19T15:32:07.401-07:00</updated><title type='text'>Host configuration -- use the hostname to configure the network</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As I imagine many people to be, when bringing up hosts, I&#39;m still stuck in the days of:&lt;br /&gt;
&lt;br /&gt;
Step 1: (node) configure networking&lt;br /&gt;
Step 2: (node) configure the hostname&lt;br /&gt;
Step 3: (service1) configure DNS to match&lt;br /&gt;
Step 4: (service2) plug this into some form of configuration management&lt;br /&gt;
Step 5: profit&lt;br /&gt;
&lt;br /&gt;
The problem is that you often have a complicated back and forth between configuration of the node and configuration of the node. If you decide to semi-automate this you might try and add dhcp into the mix:&lt;br /&gt;
&lt;br /&gt;
Step 1: (service1) Allocate IP address for a node&lt;br /&gt;
Step 2: (node) Get MAC address from node&lt;br /&gt;
Step 3: (service2) Plug MAC+IP into DHCP configuration&lt;br /&gt;
Step 4: (service1+service2) Push out changes to dhcp/dns&lt;br /&gt;
Step 5: (node) initialize networking using DHCP&lt;br /&gt;
Step 6: profit&lt;br /&gt;
&lt;br /&gt;
Adding in IPv6 and SLAAC, things get worse since you have to grab the SLAAC address after networking is brought up and that means two different changes to DNS. Pretty soon, you are spending several minutes just moving basic data between services on your network.&lt;br /&gt;
&lt;br /&gt;
ENTER IPv6 and a slight amount of thought:&lt;br /&gt;
&lt;br /&gt;
I recently had some other push factors (related to our private cloud) to try and minimize the effort spent here. I now use SLAAC and an IPv6 DNS address as a temporary configuration point. Then I query DNS for the information I need to configure the node. This basically just comes down to IPv4 and IPv6 address at the moment:&lt;br /&gt;
&lt;br /&gt;
Step 1: (service1) Allocate IPv4 and IPv6 address&lt;br /&gt;
Step 2: (node) bring up node with temporary (SLAAC) config&lt;br /&gt;
Step 3: (node) query DNS for addresses and plug the values into a static configuration&lt;br /&gt;
Step 4: profit&lt;br /&gt;
&lt;br /&gt;
Now all I need is a script on the new node to make this much faster and viola! My configuration is down to two steps:&lt;br /&gt;
&lt;br /&gt;
Step 1: (service1) Allocate addresses&lt;br /&gt;
Step 2: (node) run: init_host new-hostname&lt;br /&gt;
Step 3: profit&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Of course, init_host runs dig and plugs values into the key places. Finally, it runs some form of configuration management (puppet in our case) to get the rest of the host configured. Since many hosts are virtual instances under OpenStack, we can simply leave an init_host script in the base image for convenience. Time taken to bring up a new node has gone from minutes of error-prone copy/paste to seconds of error-prone typing. I&#39;m much more likely to be careful over a period of seconds with a few steps than a period of minutes with many steps. Hopefully our infrastructure will benefit ... and hopefully yours will too!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/2048395067560876480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2014/03/host-configuration-use-hostname-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2048395067560876480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2048395067560876480'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2014/03/host-configuration-use-hostname-to.html' title='Host configuration -- use the hostname to configure the network'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-7178728270057463214</id><published>2014-03-03T22:56:00.001-07:00</published><updated>2014-03-03T22:56:56.885-07:00</updated><title type='text'>Napa Valley Marathon - 2014</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I live in a beautiful city that is practically ideal for runners in the winter. There are long flat areas to run as well as hilly and mountainous regions to train in depending on your goals. There is also an abundance of sunshine and ever so slight lack of oxygen at 2500&#39; above sea level. To clarify, it&#39;s an ideal place for winter training for an early spring marathon since the summer gets pretty hot.&lt;br /&gt;
&lt;br /&gt;
This training season has been non-ideal in many ways (stress fracture which meant one month with no running) and very little speed/strength training. I made my focus entirely on my long runs which I was just barely able to schedule before the marathon with two 20 mile runs on two successive weekends. The last one was on flat-as-a-pancake pavement with two weeks (one weekend) worth of tapering before the marathon. Given my somewhat ad-hoc training plan, I didn&#39;t have a solid goal pace in mind and was planning on winging it somewhat.&lt;br /&gt;
&lt;br /&gt;
On race weekend, my diet varied from very decent hotel breakfasts to dark chocolate peanut butter cups. Suffice to say, I should have been a little more regimented with my food. Pre-race dinner wasn&#39;t bad but I probably could have done better by adding a potato somehow for potassium. I had chicken, rice and veggies. I did manage to avoid wine and drank plenty of water throughout the day so that I would be able to spend less time worrying about hydration during the run. In hindsight, I may have had a little too much water and not enough salt/potassium to stay balanced.&lt;br /&gt;
&lt;br /&gt;
Ok, ready, set, go! I woke up on race morning with very little sleep. My neighbors in the hotel decided to come back at 2 am in the morning the previous night and have an hour long conversation. This night wasn&#39;t as bad since they started at midnight instead of 2 am. Of course, I had to wake up at 4:00 so I could leave by 4:30 to walk to the busses that left the finish area at 5:15 for the race that started at 7. To be fair to the race directors, I think this was just enough time for all logistics to be worked out for the crowd but I did spend 30 minutes on the bus after we arrived waiting to be kicked off. I think I will try to stay in Calistoga (close to the start) instead of Napa for those precious extra few hours of sleep if I run this again.&lt;br /&gt;
&lt;br /&gt;
Chatter on the bus while driving up was the usual range of topics between runners. &quot;This is my first marathon&quot; ... &quot;doesn&#39;t matter if it&#39;s your first, your 50th or you are 20 or 60, the feeling at the beginning is always the same&quot; ... &quot;does anyone know what the weather is supposed to be?&quot; Ok, the last one may not be as typical on race day but the weather report had varied wildly in the past week. The forecast went from &quot;no rain&quot; on race day to &quot;it&#39;s gonna rain&quot; and everywhere in between. The night before the race I checked and there was a 0% chance. I took that and planned for only slightly worse. Thankfully I did plan for slightly worse.&lt;br /&gt;
&lt;br /&gt;
At the start, I saw some friends in passing and made a few new ones. I saw a guy standing on his own and decided to make simple conversation. Jim &amp;nbsp;would be happy for a sub-4 and hadn&#39;t run a marathon in a while. He asked what I was planning on and I let him know that I was hoping for 3:20 - 3:40 but was going to just see what happened. He seemed impressed and we continued chatting for a little bit. I saw another friend a little bit ahead, went to wish her good luck and then made my way back through the pack so I didn&#39;t get caught up in the rush of the start. I tend to go out to fast if I am too far in the front and so I compensate by starting a little further back and taking it easy for a mile.&lt;br /&gt;
&lt;br /&gt;
After some poetry, the national anthem and the usual positive heckling of the announcer, we were off! I started further back than usual because people were walking all the way up to the starting line (which was chip timed.) I wasn&#39;t trying to PR so I did my best to just go with it and then gently pass people until I reached a slightly faster group. I did my usual identify people by race shirts they had on and say, &quot;go Ragnar!&quot; for people with Ragnar shirts. This worked well for a while until about mile 2 where I was able to hit my target range.&lt;br /&gt;
&lt;br /&gt;
I caught up with some friends who were running the course for the heck of it. They originally signed up for the race but had injuries during training and thus planned on not doing it. The night before, there was wine and &quot;good&quot; decision making so the whole group decided to start the race and see what happened. I caught up to a few people in the group and passed them without realizing it was them. Once I had gone a little ways ahead they called me on it and caught up. We ran together for a short period and they definitely had their own conversation going. I decided to let the ladies talk while I keep focusing on my run which was starting to feel increasingly difficult.&lt;br /&gt;
&lt;br /&gt;
I was breathing much harder than I would have at the same pace which seemed odd given that I was 2000&#39; of elevation lower than usual. Eventually they pulled past and I started throttling my pace back. My body wasn&#39;t hurting or feeling tired but I was starting to feel a lot of mental resistance; Far more than should happen around mile 3 or 4. I couldn&#39;t really lock on what was problematic and so I equated the stress to negative thoughts and tried pulling myself out of them.&lt;br /&gt;
&lt;br /&gt;
I passed Jim and he surprised me, &quot;Hey Tim, way to go!&quot; I had to look back a little to recognize him and cheered him on too. There was still a lot positive energy in the air and some surrounding runners chuckled at the exchange. I think he finished with, &quot;I&#39;ll see you at the end!&quot;&lt;br /&gt;
&lt;br /&gt;
The spectators were great along the sides of the road. Nice posters and positive (but not over the top) comments for the passing runners. One group was even offering an entire line of high-fives. I think that was the fastest part of the course for me. I am a total sucker for that sort of thing and love to play into it. My gps log shows a single peak at 2 minutes faster than my target pace. I&#39;m glad only one crowd was that organized with the high-fives.&lt;br /&gt;
&lt;br /&gt;
I kept the pace, or at least I thought I was for a while. The resistance was getting unusually difficult to wade through. I tried everything to get positive thoughts flowing. I looked around at the beautiful grape fields and hills, enjoyed the cool temperatures, appreciated the runners around me, and came back to thinking of wine at the end. Just pushing through wasn&#39;t working either. Nothing helped. It&#39;s a downhill race with an uphill battle. Finally, I dropped my pace by two minutes for a half mile to try and reset a little bit. There was no way I could sustain this mentally even though my body was feeling mostly ok. Finally, I decided to walk. That&#39;s a tough decision for me, especially before mile 13.&lt;br /&gt;
&lt;br /&gt;
The resistance I felt just would not give up. I started employing tactics such as 1 mile on and then a short walk/jog rest to try and break out of the head space. Once I figured out that I could walk, I started walking more and my overall pace was starting to really suffer. Jim caught up to me and asked what was wrong. I just kinda shook my head and said, &quot;it&#39;s all mental.&quot; He knew exactly what I was saying and gave me an encouraging pat on the back. After talking for a little bit he continued on, &quot;I&#39;ll wait for you at the finish!&quot; At that point, a course motor cycle monitor looked back and asked for a thumbs up/thumbs down. I gave him a thumbs up but I noticed he took a moment to believe me and he didn&#39;t ask someone ahead of me that was also walking.&lt;br /&gt;
&lt;br /&gt;
Finally, I suspected that this may be food related. I didn&#39;t plan on taking anything but salt pills and aid-station water which had worked fine for long runs in the past. There was an emergency GU in my pocket but I did not want to resort to that if I didn&#39;t have too. I started accepting gatorade and eventually bananas and even went back for seconds a few times. By mile 19, I was starting to feel a little less mental fatigue but all the walk breaks and cold had told my body, &quot;ok, we are basically done.&quot; I then walked for half a mile trying to just focus on gradually increasing steam. I was hoping I could build up a little momentum and start into a jog that would eventually become a run again. I started an easy pace and decided that I had to hold it for a mile to see what happened.&lt;br /&gt;
&lt;br /&gt;
I walked again for a brief period, started up and then it happened; My right calf started knotting up when I would land/push off. No longer was it just a question in my mind about running vs not, my body was enforcing that I could not run. By this point I had gotten past the, &quot;maybe I should drop&quot; thoughts and graduated to, &quot;if I have to walk 6 miles then so be it.&quot; My mental state was getting much better but my body worse which reinforced the fuel-related diagnosis.&lt;br /&gt;
&lt;br /&gt;
What was nice about passing mile 20 is that others were also hitting a wall. I wasn&#39;t alone anymore! There were people passing and walking ahead. Some people walked around me and someone even passed and said, &quot;go Ragnar!&quot; since I had my oldest Ragnar shirt on. That managed to bring a smile to my face.&lt;br /&gt;
&lt;br /&gt;
I walked for two miles and tried again. Nope! Not happening. Potassium doesn&#39;t come from mid-air but rather from aid-station volunteers. Finally, an aid station! Lots of gatorade, water to help dilute it, a salt pill and as many bananas as I could hold with a cup of water. I gave myself 10 minutes to let the salt be absorbed into my system and let the food ease its way into a safe place. &quot;Ok, let&#39;s try running again,&quot; I thought to myself. Nope. Nope nope nope! One more time? Nope. Fine, little more walking, but damnit, I&#39;m making it!&lt;br /&gt;
&lt;br /&gt;
In the the final stretch, once I got over all the people passing me, I found new motivation. If I couldn&#39;t run, I was going to walk as fast as I could. Constant forward motion was my goal. I tried running a few times and after analyzing the knots trying to form in my calf I finally figured out that if I used my heel a little more and my forefoot a little less, I could jog. Normally, this is not how I optimize my run. I wear minimal footwear and heel strikes are considered dangerous. The shoes I was wearing had several millimeters of padding, however, so I figured I could get away with it.&lt;br /&gt;
&lt;br /&gt;
I thought to myself, &quot;I&#39;m going to make it, no matter what I need to do.&quot; The light at the end of the tunnel was starting to twinkle through slowly and the only thing keeping me from shedding a few tears of happiness were well placed crowds of people cheering on runners. They probably wouldn&#39;t have noticed given the light but constant rain that was falling by now. Runners themselves were saying motivating things as they pass. Sometimes it was for themselves via a mantra to keep going, other times it was definitely aimed at me. Either way, it was inspiring.&lt;br /&gt;
&lt;br /&gt;
Ok, new goal with new information: I&#39;m going to run through the finish. Oh, someone has homemade sorbet! I stopped and asked briefly about flavors. I finally chose the lightly colored one and it was SO GOOD. If the person who made that and stood out in the cold to serve sorbet is reading this, &quot;Thank you! Something about it made me feel instantly better.&quot; I jogged out of sight and the cramps came back. So close! Walk for a moment... then start up again. Nope. Ok, let&#39;s walk and conserve a little energy. I&#39;m running through this finish no matter what.&lt;br /&gt;
&lt;br /&gt;
One spectator had measured 0.2 miles beyond the 25 mile post. She was trying to inspire people to keep going since there was exactly one mile. Again, being a sucker for spectators, I played into it, got a fist bump and started running. Oops, slowly, right ... cramps. Ok, I can do a mile! I can always do a mile!&lt;br /&gt;
&lt;br /&gt;
With the finish area in sight, both of my calves were starting to cramp up even with my modified run. I finally decided I didn&#39;t care and just did whatever I had to in order to keep my body moving forward through the finish. I vaguely saw the finish clock in so much as to recognize a &quot;4&quot; as the first number... which I was well aware of anyway. I crossed all three finish matts and was greeted by someone immediately after I stopped running. She was looking me very intently in the eyes and I was trying really hard to recognize this person. Did I know her? Was she part of the group I came with? She had a lot of stuff on to stay warm/dry but I finally figured out she was trying to assess my state. I mentioned some cramping and she mentioned some medical tents. Someone placed a medal around my neck while another placed a heat blanket around my shoulders. The medal is cool but, hands down, it was the heat blanket that won in my mind.&lt;br /&gt;
&lt;br /&gt;
This was definitely not the marathon I planned to run but there is no way you could get me to change a thing about it for the world. My time was an hour slower than anticipated, my body still hurts and I&#39;m pretty sure I&#39;ll have a few nagging injuries for a while but the memories will last a lifetime.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/7178728270057463214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2014/03/napa-valley-marathon-2014.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7178728270057463214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7178728270057463214'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2014/03/napa-valley-marathon-2014.html' title='Napa Valley Marathon - 2014'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-2853627875286135808</id><published>2014-02-25T17:33:00.001-07:00</published><updated>2014-02-25T21:07:31.755-07:00</updated><title type='text'>OpenStack and Glance Image Types vs Size</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I have looked around for good information on images and support for sparse storage and compression. After experimenting a bit I decided to compile a few key results. There are two attributes I care about here: storage and network transfer.&lt;br /&gt;
&lt;br /&gt;
In order for efficient storage of an image, the image must be as small as possible. If there is a run of no data on an image (free space that has been filled with zeros) then that should not reserve bits on the filesystem. The key term here is &quot;sparse image.&quot; Once you transfer a sparse image to another host, the &quot;sparse bits&quot; actually get transmitted as long strings of zeros... thus you transfer 10 GB of data for a 10 GB sparsely allocated image with (say) 6 GB of actual filesystem data.&lt;br /&gt;
&lt;br /&gt;
In order to be efficient for a network transfer, the image has to actually be small which ends up meaning compression. (eg: gzip/bzip2/...)&lt;br /&gt;
&lt;br /&gt;
I used an LVM backed instance for my source data and in order to fill zeros into the free space of the block storage I ran this inside the instance:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;dd if=/dev/zero of=/tmp/zeros bs=4M; rm /tmp/zeros; halt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;This basically just wrote zeros into a file under /tmp, removed it and then halted the instance. You may need to use a different location on your host because /tmp is sometimes mounted as a different filesystem (eg: tmpfs.)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Now, my lv is ready to convert to different image types. I used qemu-img in order to read from the block device to create images of different varieties:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;qemu-img convert -c -O qcow2 /dev/vg/kvm-woof.snap host-woof.compressed.qcow2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;qemu-img convert -O qcow2 /dev/vg/kvm-woof.snap host-woof.qcow2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;qemu-img convert -O vdi /dev/vg/kvm-woof.snap host-woof.vdi&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;qemu-img convert -O vmdk /dev/vg/kvm-woof.snap host-woof.vmdk&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;The differences between sizes somewhat surprised me:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;root@os-ph1:/staging# ls -lh host-woof.*&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 root root 2.1G Feb 25 17:01 host-woof.compressed.qcow2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 root root 6.3G Feb 25 16:52 host-woof.qcow2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 root root &amp;nbsp;10G Feb 25 16:42 host-woof.raw&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 root root 6.9G Feb 25 16:49 host-woof.vdi&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 root root 6.3G Feb 25 16:49 host-woof.vmdk&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A raw image is pretty much the worst thing you can do. It turns out that only the qcow2 format supports compression within the image itself. There are some downsides to qcow2 with performance but certainly if you are creating/destroying VMs a lot then you can save yourself some network bandwidth by transferring smaller images. Creating the compressed qcow2 image took roughly twice as long (no hard numbers here) as the uncompressed version. YMMV as not all data is created equal (or equally compressible).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It&#39;s also interesting to note that a compressed qcow2 image may slowly expand through use. New writes to the image may not be compressed.&lt;br /&gt;
&lt;br /&gt;
-- EDIT --&lt;br /&gt;
&lt;br /&gt;
I use LVM to back instances on hosts in OpenStack. It turns out that regardless of the format chosen, the whole (raw) image still needs to be written out to the logical volume. Unless you have really fast disks, this is by far the slowest part of the process. At least in my environment (with spinning rust) all I gain is some space on my image store and less overall used network bandwidth. Also, images are cached in a raw format on each node. The image also acts something like a sparse image:&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;root@os-ph12:/var/lib/nova/instances/_base# ls -lh abcca*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;-rw-r--r-- 1 nova nova 10G Feb 25 21:05 abcca5bbe40c5b147f8a110bf81dab8bbb65db25&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;root@os-ph12:/var/lib/nova/instances/_base# du -h abcca*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;6.2G &amp;nbsp; &amp;nbsp;abcca5bbe40c5b147f8a110bf81dab8bbb65db25&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/2853627875286135808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2014/02/openstack-and-glance-image-types-vs-size.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2853627875286135808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2853627875286135808'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2014/02/openstack-and-glance-image-types-vs-size.html' title='OpenStack and Glance Image Types vs Size'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-1901031393687830077</id><published>2014-01-07T22:55:00.001-07:00</published><updated>2014-01-07T22:55:08.329-07:00</updated><title type='text'> &quot;Unavailable console type spice&quot; -- Another OpenStack Error</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Tonight, I found myself trying to implement the spice proxy out of curiosity in havana. I found a nice post that talked about how to do this after banging my head on the wall for a while:&amp;nbsp;http://joshrestivo.com/?p=32&lt;br /&gt;
&lt;br /&gt;
Anyway, this lead to getting &quot;&lt;span style=&quot;background-color: #f2dede; color: #b94a48; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;console is currently unavailable. Please try again later.&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;btn btn-mini&quot; href=&quot;http://horizon.lpl.arizona.edu/horizon/project/instances/62406734-3b15-436f-b394-86f6c662c5b1/&quot; style=&quot;-webkit-box-shadow: rgba(255, 255, 255, 0.2) 0px 1px 0px inset, rgba(0, 0, 0, 0.0470588) 0px 1px 2px; background-color: whitesmoke; background-image: -webkit-linear-gradient(top, rgb(255, 255, 255), rgb(230, 230, 230)); background-repeat: repeat no-repeat; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-color: rgb(204, 204, 204) rgb(204, 204, 204) rgb(187, 187, 187); border-style: solid; border-top-left-radius: 4px; border-top-right-radius: 4px; border-width: 1px; box-shadow: rgba(255, 255, 255, 0.2) 0px 1px 0px inset, rgba(0, 0, 0, 0.0470588) 0px 1px 2px; color: #333333; cursor: pointer; display: inline-block; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11px; line-height: 14px; margin-bottom: 0px; padding: 2px 6px; text-align: center; text-decoration: none; text-shadow: rgba(255, 255, 255, 0.74902) 0px 1px 1px; vertical-align: middle;&quot;&gt;Reload&lt;/a&gt;&quot; when I tried to load a console of an already running host. I dove into the stack trace I received in the nova-compute logs:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 ERROR nova.openstack.common.rpc.amqp [req-4ad10aaf-60c0-4f88-8964-cb3f6dd06814 6c978326923a4fa997a6a83b3fdbd11e 47eedd8414b84466a731289a5d6dee35] Exception during message handling&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 461, in _process_data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; **args)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py&quot;, line 172, in dispatch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; result = getattr(proxyobj, method)(ctxt, **kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/common.py&quot;, line 439, in inner&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; return catch_client_exception(exceptions, func, *args, **kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/common.py&quot;, line 420, in catch_client_exception&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; return func(*args, **kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/exception.py&quot;, line 90, in wrapped&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; payload)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/exception.py&quot;, line 73, in wrapped&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; return f(self, context, *args, **kw)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/compute/manager.py&quot;, line 271, in decorated_function&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; e, sys.exc_info())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/compute/manager.py&quot;, line 258, in decorated_function&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; return function(self, context, *args, **kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/compute/manager.py&quot;, line 3579, in get_spice_console&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; connect_info = self.driver.get_spice_console(instance)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py&quot;, line 2199, in get_spice_console&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; ports = get_spice_ports_for_instance(instance[&#39;name&#39;])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py&quot;, line 2197, in get_spice_ports_for_instance&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; raise exception.ConsoleTypeUnavailable(console_type=&#39;spice&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp ConsoleTypeUnavailable: Unavailable console type spice.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.402 5706 TRACE nova.openstack.common.rpc.amqp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2014-01-07 22:41:51.404 5706 ERROR nova.openstack.common.rpc.common [req-4ad10aaf-60c0-4f88-8964-cb3f6dd06814 6c978326923a4fa997a6a83b3fdbd11e 47eedd8414b84466a731289a5d6dee35] Returning exception Unavailable console type spice. to caller&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
and the final hint was a comment in the source:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;# head -2197 /usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py | tail -3&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # NOTE(rmk): We had Spice consoles enabled but the instance in&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # question is not actually listening for connections.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; raise exception.ConsoleTypeUnavailable(console_type=&#39;spice&#39;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Turns out that running VMs have VNC or SPICE nailed into their configuration:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;root@os-ph12:/# EDITOR=cat virsh edit instance-000000a1 &amp;nbsp;| egrep &#39;graphics.*(spice|vnc)&#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;graphics autoport=&quot;yes&quot; keymap=&quot;en-us&quot; listen=&quot;192.168.18.5&quot; type=&quot;spice&quot;&gt;&lt;/graphics&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;root@os-ph12:/# EDITOR=cat virsh edit instance-000000a0 &amp;nbsp;| egrep &#39;graphics.*(spice|vnc)&#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;graphics autoport=&quot;yes&quot; keymap=&quot;en-us&quot; listen=&quot;192.168.18.5&quot; port=&quot;-1&quot; type=&quot;vnc&quot;&gt;&lt;/graphics&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
thus the VMs needed to be rebuilt on the host with spice.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/1901031393687830077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2014/01/unavailable-console-type-spice-another.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1901031393687830077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1901031393687830077'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2014/01/unavailable-console-type-spice-another.html' title=' &quot;Unavailable console type spice&quot; -- Another OpenStack Error'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-7985609696605158620</id><published>2013-09-13T20:13:00.002-07:00</published><updated>2013-09-13T20:13:24.718-07:00</updated><title type='text'>OpenStack Error Reporting</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
OpenStack is a conceptually neat piece of software. It&#39;s very distributed and fault-tolerant and loosely coupled. That also means that getting back meaningful errors can be a tough process when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
Today, I upgraded my development cluster from Grizzly to Havanah. I spent several hours understanding new and changed config options throughout the landscape and updated my puppet definitions to spread these new changes across the nodes. I finally decided to go home and get some food before attempting to finish debugging some of the errors coming up from various nodes. I&#39;ve complained to colleagues in the past about error reporting and how non-trivial it is to trace things through OpenStack. Well, here is a prime example.&lt;br /&gt;
&lt;br /&gt;
In Horizon (the Web-GUI for mortals to use OpenStack), I tried creating an instance. It simply said it couldn&#39;t do it and left a cryptic error with a uuid listed. I&#39;m used to this by now so I jump to the error logs in the apache log for Horizon. Not much there either. Hmm ... well, I just upgraded *everything* so where do I start? How about a compute node... after all, that&#39;s where the instance is supposed to start. Let&#39;s see if anything is going on there. Probe around a little and notice that nova-compute isn&#39;t actually running. Simple! Let&#39;s just start that up. Oh wait, the daemon is still not running. Now I have something in my error logs:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 ERROR nova.openstack.common.threadgroup [-] Remote error: UnsupportedRpcVersion Specified RPC version, 1.50, not supported by this endpoint.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;[u&#39;Traceback (most recent call last):\n&#39;, u&#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 430, in _process_data\n &amp;nbsp; &amp;nbsp;rval = self.proxy.dispatch(ctxt, version, method, **args)\n&#39;, u&#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py&quot;, line 138, in dispatch\n &amp;nbsp; &amp;nbsp;raise rpc_common.UnsupportedRpcVersion(version=version)\n&#39;, u&#39;UnsupportedRpcVersion: Specified RPC version, 1.50, not supported by this endpoint.\n&#39;].&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup Traceback (most recent call last):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py&quot;, line 117, in wait&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; x.wait()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py&quot;, line 49, in wait&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return self.thread.wait()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/eventlet/greenthread.py&quot;, line 168, in wait&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return self._exit_event.wait()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/eventlet/event.py&quot;, line 116, in wait&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return hubs.get_hub().switch()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py&quot;, line 187, in switch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return self.greenlet.switch()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/eventlet/greenthread.py&quot;, line 194, in main&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; result = function(*args, **kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/service.py&quot;, line 65, in run_service&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; service.start()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/service.py&quot;, line 156, in start&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; self.manager.init_host()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/compute/manager.py&quot;, line 752, in init_host&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; context, self.host, expected_attrs=[&#39;info_cache&#39;])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/objects/base.py&quot;, line 90, in wrapper&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; args, kwargs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/conductor/rpcapi.py&quot;, line 507, in object_class_action&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return self.call(context, msg, version=&#39;1.50&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/proxy.py&quot;, line 126, in call&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; result = rpc.call(context, real_topic, msg, timeout)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/__init__.py&quot;, line 140, in call&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; return _get_impl().call(CONF, context, topic, msg, timeout)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/impl_kombu.py&quot;, line 824, in call&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; rpc_amqp.get_connection_pool(conf, Connection))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 539, in call&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; rv = list(rv)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 504, in __iter__&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup &amp;nbsp; &amp;nbsp; raise result&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup RemoteError: Remote error: UnsupportedRpcVersion Specified RPC version, 1.50, not supported by this endpoint.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup [u&#39;Traceback (most recent call last):\n&#39;, u&#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 430, in _process_data\n &amp;nbsp; &amp;nbsp;rval = self.proxy.dispatch(ctxt, version, method, **args)\n&#39;, u&#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py&quot;, line 138, in dispatch\n &amp;nbsp; &amp;nbsp;raise rpc_common.UnsupportedRpcVersion(version=version)\n&#39;, u&#39;UnsupportedRpcVersion: Specified RPC version, 1.50, not supported by this endpoint.\n&#39;].&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.959 4504 TRACE nova.openstack.common.threadgroup&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-13 19:07:08.962 4504 DEBUG amqp [-] Closed channel #1 _do_close /usr/lib/python2.7/dist-packages/amqp/channel.py:88&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Yup, clear as mud. I try the usual, &quot;plug this into a popular search engine and see who else is getting the error.&quot; Nobody! Wow, a brand new one! Woohoo... Happy Friday. Fine, this is open source and written in python, let&#39;s just dive into the code a little and see where the culprit is. Aha! This is an error we get when we don&#39;t know what is going on. The last case(in fact the last line) of the file.&lt;br /&gt;
&lt;br /&gt;
So, let&#39;s try a little harder. We are dealing with RPC and we are getting a version issue. Something... Somewhere... doesn&#39;t like talking to me. Maybe it&#39;s the message server itself? *poke around with that* Other things seem fine, no errors to report there. Let&#39;s run nova-compute in debug mode in the foreground and see if we can glean anything about where it is failing. Hmm, one of the last things it reports on is talking to nova-conductor. Let&#39;s have a look at nova-conductor logs ... WOAH! That same error message! That&#39;s right, nova-conductor is *returning* this error for some reason:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 ERROR nova.openstack.common.rpc.amqp [req-cd3c0d15-fa20-486a-8935-2ed5fec76f7d None None] Exception during message handling&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 430, in _process_data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; rval = self.proxy.dispatch(ctxt, version, method, **args)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py&quot;, line 138, in dispatch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp &amp;nbsp; &amp;nbsp; raise rpc_common.UnsupportedRpcVersion(version=version)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp UnsupportedRpcVersion: Specified RPC version, 1.50, not supported by this endpoint.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.394 17496 TRACE nova.openstack.common.rpc.amqp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.397 ERROR nova.openstack.common.rpc.common [req-cd3c0d15-fa20-486a-8935-2ed5fec76f7d None None] Returning exception Specified RPC version, 1.50, not supported by this endpoint. to caller&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;2013-09-14 02:27:19.399 ERROR nova.openstack.common.rpc.common [req-cd3c0d15-fa20-486a-8935-2ed5fec76f7d None None] [&#39;Traceback (most recent call last):\n&#39;, &#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py&quot;, line 430, in _process_data\n &amp;nbsp; &amp;nbsp;rval = self.proxy.dispatch(ctxt, version, method, **args)\n&#39;, &#39; &amp;nbsp;File &quot;/usr/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py&quot;, line 138, in dispatch\n &amp;nbsp; &amp;nbsp;raise rpc_common.UnsupportedRpcVersion(version=version)\n&#39;, &#39;UnsupportedRpcVersion: Specified RPC version, 1.50, not supported by this endpoint.\n&#39;]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I guess this should have been clear given all of the blatant references to nova-conductor. In fact, I was able to find the term &quot;conductor&quot; once in the backtrace which is pretty good for this kind of problem. So, this *must* be the source of my issue since this is where the error is being generated. Well, tonight, I got lucky. A package wasn&#39;t updated and doing a dist-upgrade to pull in matching packages fixed the issue. However, this is a scary place to be:&lt;br /&gt;
&lt;br /&gt;
Upgrading one component (or not upgrading another) can cause components to completely fail on remote nodes. If I had 100 nova-compute nodes and a single node with an outdated nova-conductor running, presumably the 100 nodes would have crashed nova-compute daemons.&lt;br /&gt;
&lt;br /&gt;
The take-away here is: make sure all components across the board are the same version for your cloud. The CLI commands seem to be able to accept a little bit of version lag but the internal components have issues with different versions running.&lt;br /&gt;
&lt;br /&gt;
The less scary part in all of this is that I&#39;m managed to keep my previously-started instances running because kvm processes were not directly affected. If I had customers that needed to start/stop processes, this would have been not fun. Of course, that&#39;s why we all keep a complete development/testing openstack cluster around, right?&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/7985609696605158620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2013/09/openstack-error-reporting.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7985609696605158620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7985609696605158620'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2013/09/openstack-error-reporting.html' title='OpenStack Error Reporting'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-1045855282215699085</id><published>2013-08-26T17:13:00.004-07:00</published><updated>2013-08-26T17:13:52.505-07:00</updated><title type='text'>OpenStack is ready for prime (test) time -- quantum/neutron rant</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I&#39;ve been spending the last year poking and prodding OpenStack in hopes of having a management layer for the various hosts with instances throughout my data center. OpenStack has so many neat little bells and whistles and ... green developers.&lt;br /&gt;
&lt;br /&gt;
My DC is pretty well established and so I need to be careful about introducing new technology. I&#39;m amused at the toy that is devStack. It seems to be the only streamlined way to install a cloud. The other way is to use pre-established puppet templates that make assumptions about how your hardware is setup. My use-case is covered by neither one so I get the third option: install everything and write my own puppet templates. This isn&#39;t even my real problem with OpenStack. My real problem is that there is no way to accomplish basic tasks that you would expect in migrating your infrastructure and while the documentation is there and pretty, it&#39;s not always clear.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s dive into my infrastructure for a moment. I run hosts with link aggregation and vlans. There are no unused ethernet ports on the back of my hosts thus there is no &quot;management port.&quot; The management network is simply another vlan on that same trunk. Between trying to figure out whether or not to use quantum and some plugin under quantum or nova-network with one of its plugins (and which version of OpenStack to go along with that decision) I was flailing miserably trying to figure out how OpenStack would allow me to manage infrastructure in the same way: link-aggregation and vlans. There is a VLAN Manager plugin and there is an Open vSwitch plugin ... both of which seemed to be promising. After hosing my entire network with the Open vSwitch plugin (it bridged all of my vlans together by connecting them directly to br-int, something I &lt;i&gt;still&lt;/i&gt; don&#39;t understand) I knew I had to hold this entire project with kid-gloves.&lt;br /&gt;&lt;br /&gt;
Finally, I found out that Quantum and the LinuxBridge plugin would do what I needed. That was quite a relief once I finally figured out the terminology used in the docs are not what a system-administrator with a networking bent would expect to see. Ok, time to get dirty! I can bring up VMs, I&#39;ve got my image service (glance) running on top of my distributed object store (swift) and it&#39;s all authenticated via a central/replicated authentication service (keystone with mysql db.) Wow, I can create a tiny little subnet with 3 IPs for testing. Ok, let&#39;s bring up a VM ... and then another. Oops, I need more IPs! No problem, there seems to be a &quot;quantum subnet-update&quot; command! Oh, hmm ... it won&#39;t let me update the allocation pool. Alright, let&#39;s remove the allocation and replace it with a larger one. No dice, IPs are allocated. How about adding another IP allocation pool to the same subnet definition? Nope, can&#39;t have the same subnet CIDR declared for two allocation pools.&lt;br /&gt;
&lt;br /&gt;
This is a *huge* problem if you are migrating hosts from a more than half-filled subnet into OpenStack. I guess it&#39;s not really a problem if you just have toy VMs on a toy network but I&#39;d really like to think that something with this much effort put into it could be put into at least a semi-production environment.&lt;br /&gt;
&lt;br /&gt;
A few other *big* problems with OpenStack:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; * logging - errors show up anywhere/everywhere except where you are looking&lt;br /&gt;
&amp;nbsp; * meaningful errors - many errors show up like, &quot;couldn&#39;t connect to host&quot; ... which host?!&lt;br /&gt;
&amp;nbsp; * stable interfaces - configuration files, configuration terms, backend daemons, ... all change between releases of OpenStack.&lt;br /&gt;
&amp;nbsp; * decent FAQ with answers - however, there are many launchpad bugs/discussions and IRC&lt;br /&gt;
&lt;br /&gt;
If, after a year, I can&#39;t figure out how to get this thing safely into my infrastructure, I seriously doubt my abilities. Well, that is, until I realized that I wasn&#39;t the only one with serious fundamental problems with the architecture fitting into my current network.&lt;br /&gt;
&lt;br /&gt;
What it seems to come down to is, either I need to significantly change the way I do things or I need to not do OpenStack.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/1045855282215699085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2013/08/openstack-is-ready-for-prime-test-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1045855282215699085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1045855282215699085'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2013/08/openstack-is-ready-for-prime-test-time.html' title='OpenStack is ready for prime (test) time -- quantum/neutron rant'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-3438961510600161740</id><published>2011-12-15T16:57:00.000-07:00</published><updated>2011-12-15T16:57:19.476-07:00</updated><title type='text'>execve under OSX Snow Leopard</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Background:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
A colleague and I are developing a piece of code (called pbsmake) in python that ends up interpreting something that looks like a Makefile. We will use pbsmake to help distribute jobs to a local scheduler (each makefile target gets its own job) but we found that we may want to use the pbsmake interpreter as a shell interpreter itself so we can simply execute certain commands (which are really like makefiles) with a target.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Most of our development has been under GNU/Linux and this works just fine. However, as soon as we do this under OSX Snow Leopard, the top-level makefile starts being executed as if it were a bash script.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
How to replicate:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;create a simple interpreter that is a shell script itself:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;/Users/imoverclocked/simple-interp.sh:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#!/bin/cat&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;This is my simple interpreter, it simply spits the file onto STDOUT&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;li&gt;create a script that uses this interpreter:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;/Users/imoverclocked/simple-script.sh:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#!/Users/imoverclocked/simple/interp.sh&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;This is a simple script that is interpreted (really, just spit out by cat)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;try and execute the simple-script.sh&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;./simple-script.sh&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Badly placed ()&#39;s.&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;li&gt;change the interpreter to first invoke /usr/bin/env as a work-around&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;/Users/imoverclocked/simple-script.sh:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#!/usr/bin/env /Users/imoverclocked/simple/interp.sh&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;This is a simple script that is interpreted (really, just spit out by cat)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;executing the script now gives the same output as on other unix-like architectures.&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;div&gt;
$ ./simple-script.sh&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
#!/bin/cat&lt;/div&gt;
&lt;div&gt;
This is my simple interpreter, it simply spits the file onto STDOUT&lt;/div&gt;
&lt;div&gt;
#!/home/pirl/tims/sh/simple-interp.sh&lt;/div&gt;
&lt;div&gt;
This is a simple script that is interpreted (really, just spit out by cat)&lt;/div&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
My guess to what is happening is that execv* can&#39;t handle the case where a script calls a script to interpret a script. One work-around is to use /usr/bin/env in the &quot;simple-script.sh&quot; header which works since /usr/bin/env is a binary executable which then invokes the script in it&#39;s own execvp call.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Apparently this works under Lion but we can&#39;t quite make the plunge across our infrastructure yet. Hope this helps someone else out there! Maybe Apple is listening?&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/3438961510600161740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/12/execve-under-osx-snow-leopard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/3438961510600161740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/3438961510600161740'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/12/execve-under-osx-snow-leopard.html' title='execve under OSX Snow Leopard'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-909434274440980800</id><published>2011-09-14T16:11:00.003-07:00</published><updated>2011-09-14T16:11:51.295-07:00</updated><title type='text'>Getting ethernet bonding to work under Debian</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
I have a small cluster of different hardware running Debian squeeze/wheezy and several machine have been really simple to setup with bonding (aka: trunking/link aggregation/port trunking/ ... the list goes on) using mode=4 or &quot;IEEE 802.3ad Dynamic link aggregation&quot;. My final clue to solving the problem was some dmesg output:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[ &amp;nbsp; 14.777381] e1000e 0000:06:00.1: eth0: changing MTU from 1500 to 9000
[ &amp;nbsp; 15.072476] e1000e 0000:06:00.1: irq 80 for MSI/MSI-X
[ &amp;nbsp; 15.128059] e1000e 0000:06:00.1: irq 80 for MSI/MSI-X
[ &amp;nbsp; 15.129468] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ &amp;nbsp; 15.129473] 8021q: adding VLAN 0 to HW filter on device eth0
[ &amp;nbsp; 16.290994] e1000e 0000:06:00.0: eth1: changing MTU from 1500 to 9000
[ &amp;nbsp; 16.586584] e1000e 0000:06:00.0: irq 79 for MSI/MSI-X
[ &amp;nbsp; 16.640053] e1000e 0000:06:00.0: irq 79 for MSI/MSI-X
[ &amp;nbsp; 16.641411] ADDRCONF(NETDEV_UP): eth1: link is not ready
...
[ &amp;nbsp; 20.530343] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[ &amp;nbsp; 20.530350] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
[ &amp;nbsp; 20.710398] bonding: bond0: Adding slave eth0.
[ &amp;nbsp; 20.710415] e1000e 0000:06:00.1: eth0: changing MTU from 9000 to 1500
[ &amp;nbsp; 21.006430] e1000e 0000:06:00.1: irq 80 for MSI/MSI-X
[ &amp;nbsp; 21.060058] e1000e 0000:06:00.1: irq 80 for MSI/MSI-X
[ &amp;nbsp; 21.061374] 8021q: adding VLAN 0 to HW filter on device eth0
[ &amp;nbsp; 21.061445] bonding: bond0: Warning: failed to get speed and duplex from eth0, assumed to be 100Mb/sec and Full.
[ &amp;nbsp; 21.061462] bonding: bond0: enslaving eth0 as an active interface with an up link.
[ &amp;nbsp; 21.242433] bonding: bond0: Adding slave eth1.

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
If I brought bond0 down/up again later I would get a working link. I tried adding &quot;sleep&quot; commands into the network init sequence to try and figure out if this was just some quiescent state that the NIC driver was in during initialization. This didn&#39;t help... so I finally read the warning about needing miimon/arp_interval/arp_ip_target for bonding to work. This was odd because my /etc/network/interfaces file looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;iface bond0 inet manual
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bond-slaves eth0 eth1 eth2 eth3
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bond-mode 4
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bond-miimon 100
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bond-xmit-hash-policy layer3+4
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mtu 9000
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dns-search lpl.arizona.edu
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; post-up ip link set $IFACE mtu 9000
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; post-up sysctl -w net.ipv6.conf.all.autoconf=0
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; post-up sysctl -w net.ipv6.conf.default.accept_ra=0

&lt;/pre&gt;
&lt;br /&gt;
As it turns out, miimon is not set when the bonding driver is loaded. To solve this problem I created a new file /etc/modprobe.d/bonding with the following content:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;alias bond0 bonding
options bonding mode=4 miimon=100
&lt;/pre&gt;
&lt;br /&gt;
This fixes the issue of bonding not working on boot and should probably be the source of a Debian/Linux bug report.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/909434274440980800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/09/getting-ethernet-bonding-to-work-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/909434274440980800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/909434274440980800'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/09/getting-ethernet-bonding-to-work-under.html' title='Getting ethernet bonding to work under Debian'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-1879568247755880093</id><published>2011-08-11T14:56:00.001-07:00</published><updated>2011-08-11T15:40:25.701-07:00</updated><title type='text'>Blender 2.5 Compositing from Python</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;If you are like me then you hate doing the same thing over and over ... which means you like to automate these kinds of processes when it makes sense to do so. I wrote a Blender plugin that &lt;a href=&quot;http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Import-Export/HiRISE_DTM_from_PDS_IMG&quot;&gt;imports a HiRISE DTM&lt;/a&gt; directly into &lt;a href=&quot;http://www.blender.org/&quot;&gt;Blender 2.5x&lt;/a&gt; and allows you to easily make fly-throughs of the various Mars locations that a DTM exists for.&lt;br /&gt;
&lt;br /&gt;
My work wants to make automated fly throughs with a trivial piece of compositing to place a foreground and background image into the blender scene. I came across very few working examples or documentation on how to use the compositing part of Blender from python so ... here we go! I&#39;ll simply place the final example code here with comments and describe each section a little more in depth below.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 1) Use compositing for our render, setup some paths&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;bpy.context.scene.use_nodes = True&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;fgImageLoc = &quot;/path/to/foreground.tiff&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;bgImageLoc = &quot;/path/to/background.tiff&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 2) Get references to the scene&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Scene = bpy.context.scene&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Tree = Scene.node_tree&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Tree.links.remove( Tree.links[0] )&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 3) The default env will have an input and an output (Src/Dst)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Src = Tree.nodes[&quot;Render Layers&quot;]&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Dst = Tree.nodes[&quot;Composite&quot;]&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 4) Let&#39;s create two groups to encapsulate our work&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node = bpy.data.node_groups.new(&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &quot;ForegroundImage&quot;,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;type=&#39;COMPOSITE&#39;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node = bpy.data.node_groups.new(&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &quot;BackgroundImage&quot;, type=&#39;COMPOSITE&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 5) The foreground group has one input and one output&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node.inputs.new(&quot;Source&quot;, &#39;RGBA&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node.outputs.new(&quot;Result&quot;, &#39;RGBA&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 6) The foreground node contains an Image and an AlphaOver node&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Image = FG_Node.nodes.new(&#39;IMAGE&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Image.image = bpy.data.images.load( fgImageLoc )&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Alpha = FG_Node.nodes.new(&#39;ALPHAOVER&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 7) The Image and the Group Input are routed to the AlphaOver&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# &amp;nbsp; &amp;nbsp;and the AlphaOver output is routed to the group&#39;s output&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node.links.new(FG_Image.outputs[&quot;Image&quot;], FG_Alpha.inputs[2])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node.links.new(FG_Node.inputs[&quot;Source&quot;], FG_Alpha.inputs[1])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;FG_Node.links.new(FG_Node.outputs[&quot;Result&quot;], FG_Alpha.outputs[&quot;Image&quot;])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 8) Add foreground image compositing to the environment&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;newFGGroup = Tree.nodes.new(&quot;GROUP&quot;, group = FG_Node)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 9) Route the default render output to the input of the FG Group&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Tree.links.new(newFGGroup.inputs[0], Src.outputs[&quot;Image&quot;])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 10) The background group has one input and one output&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node.inputs.new(&quot;Source&quot;, &#39;RGBA&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node.outputs.new(&quot;Result&quot;, &#39;RGBA&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 11) The background group contains an Image and AlphaOver node&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Image = BG_Node.nodes.new(&#39;IMAGE&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Image.image = bpy.data.images.load( bgImageLoc )&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Alpha = BG_Node.nodes.new(&#39;ALPHAOVER&#39;)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# 12) Create links to internal nodes&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node.links.new(BG_Image.outputs[&quot;Image&quot;], BG_Alpha.inputs[1])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node.links.new(BG_Node.inputs[&quot;Source&quot;], BG_Alpha.inputs[2])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;BG_Node.links.new(BG_Node.outputs[&quot;Result&quot;], BG_Alpha.outputs[&quot;Image&quot;])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;# Add background image compositing, similar to 8/9&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;newBGGroup = Tree.nodes.new(&quot;GROUP&quot;, group = BG_Node)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Tree.links.new(newBGGroup.inputs[0], newFGGroup.outputs[0])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;Tree.links.new(newBGGroup.outputs[0], Dst.inputs[&quot;Image&quot;])&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
When you run this you will end up with a pipeline that looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnWWdrHitzOkGgKim1QTm64ASatwffhQ1bfJkzcbC8hHiUa7FiBjxveGGjtENRTo_yzHvznjfZv1BjEG1aywa8-baMsrhJWalHEY253Mm85WBspZnYN_9vLHtOvxLRDySIpM-auxtpe64/s1600/blender-composite-fg-bg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnWWdrHitzOkGgKim1QTm64ASatwffhQ1bfJkzcbC8hHiUa7FiBjxveGGjtENRTo_yzHvznjfZv1BjEG1aywa8-baMsrhJWalHEY253Mm85WBspZnYN_9vLHtOvxLRDySIpM-auxtpe64/s400/blender-composite-fg-bg.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The rendered scene outputs to the foreground image group which then outputs to the background image group which then outputs to the specified file path in Blender.&amp;nbsp;Each group is a composite of primitives in blender. When expanded (via selecting the group and pressing Tab) you will see this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrWzfgsPE64PfL63i7b3HnoGJjOhCmTx9pReqhoZAAFg6kw3mwAJp9MFo7vfIpL3MLm4VFzC_3CaWBRnkzL6ZqMFE6w9tI7Vq3oJtPctHjSpw98LcZRvp6xk4DBKvyd1Bf8J2ICuMjy78/s1600/blender-composite-fg-expanded.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrWzfgsPE64PfL63i7b3HnoGJjOhCmTx9pReqhoZAAFg6kw3mwAJp9MFo7vfIpL3MLm4VFzC_3CaWBRnkzL6ZqMFE6w9tI7Vq3oJtPctHjSpw98LcZRvp6xk4DBKvyd1Bf8J2ICuMjy78/s400/blender-composite-fg-expanded.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The group input and Image outputs are routed into the Alpha Over image. The Alpha Over output is routed into to the groups output. This will overlay the Image node onto the scene. A similar setup is produced for the background image.&lt;br /&gt;
&lt;br /&gt;
Here is a slightly more detailed breakdown of the script:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Tell blender that we have a special compositing setup&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;also, store info about where our foreground/background images are kept&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Blender&#39;s environment is not empty by default.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Get a reference to it&lt;/li&gt;
&lt;li&gt;Clear the link between the Render Layer and the Composite output&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Get a reference to the default nodes for later use&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Src is the source for rendered content from the scene&lt;/li&gt;
&lt;li&gt;Dst is the node that takes an output and generates a file (or preview)&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;To simplify our compositing graph, create two groups to encapsulate each function&lt;/li&gt;
&lt;li&gt;The group we just created has one input and one output&lt;/li&gt;
&lt;li&gt;Create two nodes&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Image - acts as an output with a static image&lt;/li&gt;
&lt;li&gt;AlphaOver - overlays two images using the alpha channel defined in the second image&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Create links between nodes.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;It&#39;s easier to see these in the image above.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Instantiate the new group in the compositing environment&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;This is where I was a little lost, the group needs to be instantiated and then a new object is returned. The input/output of the returned object are the external input/output ports of the group. If you use the previous object you will make bad connections to the internal structures of the group. Don&#39;t do it!&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Connect the rendered image to the foreground group input.&lt;/li&gt;
&lt;li&gt;through 12. are pretty much the same as 5. through 9.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Different connections make the image a background image instead of a foreground image&lt;/li&gt;
&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;
Thanks to Uncle_Entity and Senshi in #blendercoders@freenode for fixing my initially poor usage.&lt;br /&gt;
&lt;br /&gt;
Here a few links that use the compositing above. Notice that the text hovers above the DTM while the background ... stays in the background:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=BzPOI-RIin4&quot;&gt;http://www.youtube.com/watch?v=BzPOI-RIin4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=w-b3smwhrW4&quot;&gt;http://www.youtube.com/watch?v=w-b3smwhrW4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/1879568247755880093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/08/blender-25-compositing-from-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1879568247755880093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/1879568247755880093'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/08/blender-25-compositing-from-python.html' title='Blender 2.5 Compositing from Python'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnWWdrHitzOkGgKim1QTm64ASatwffhQ1bfJkzcbC8hHiUa7FiBjxveGGjtENRTo_yzHvznjfZv1BjEG1aywa8-baMsrhJWalHEY253Mm85WBspZnYN_9vLHtOvxLRDySIpM-auxtpe64/s72-c/blender-composite-fg-bg.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-2231936938723104902</id><published>2011-04-30T00:12:00.000-07:00</published><updated>2011-04-30T00:12:29.427-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IPv6 IPv4 Mapped addresses linux solaris nginx ejabberd"/><title type='text'>IPv6 - how to listen?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In working with IPv6 I&#39;ve come to realize that there are a lot of funny defaults out there. The most basic of them seems to be in how to bind to a port. Simple? Yeah ... or so I thought.&lt;br /&gt;
&lt;br /&gt;
Under some versions Linux if you are to just listen on, say, [::]:80 then people connecting to your site via IPv4 might be logged as ::ffff:192.0.32.10 which is an &lt;a href=&quot;http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses&quot;&gt;IPv4 mapped IPv6 address&lt;/a&gt;. This means that everyone is allowed to talk IPv4 but your server gets to deal with everything as if it is an IPv6 address... pretty much. DNS resolution gets a little fuzzy here but we&#39;ll sweep that issue under the carpet for the remainder of this post.&lt;br /&gt;
&lt;br /&gt;
Under other versions of Linux, you may not accept IPv4 connections at all by listening on just [::]:80. As it turns out, this is a configurable default and there are (of course) arguments both ways about which is better. I personally like the one socket fits all approach but I&#39;m also very pro-IPv6. The magic default under Linux can be found/set via &quot;sysctl net.ipv6.bindv6only&quot;.&lt;br /&gt;
&lt;br /&gt;
Stepping outside of the wonderful world of Linux and into the world of Solaris/OpenSolaris (RIP) you&#39;ll find a pretty consistent behavior towards what Linux would know as&amp;nbsp;net.ipv6.bindv6only=1. In fact, I never did find a way to change the default under Solaris and had to revert to using funky configurations that specified two listening sockets: one for IPv4 and another for IPv6. In some cases this was more than a simple annoyance, it was impossible. In the case of&amp;nbsp;&lt;a href=&quot;http://www.ejabberd.im/node/4163&quot;&gt;Ejabberd&lt;/a&gt;, things get ugly. There is no way to specify which behavior you want and, on top of that, the connections are managed via a hash by port inside Ejabberd. That means you can&#39;t listen twice on the same socket! I hacked around this issue in our environment but I look forward to not needing it in the future.&lt;br /&gt;
&lt;br /&gt;
Another place this becomes a problem is in our nginx configurations. On Solaris we have something that looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;server {
 listen 80;
 listen [::]:80;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
but migrating this configuration to Linux where the default is net.ipv6.bindv6only=0, we simply use:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;server {
 listen   [::]:80;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; ...&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Which does close to the same thing. Our log files may change a little since ::ffff: is now in front of our IPv4 entries but everything else pretty much stays the same.&lt;/div&gt;&lt;br /&gt;
Alternatively we can do (for the default server):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;server {
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; listen   80;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; listen   [::]:80 default ipv6only=on;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;/div&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; ...&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
and then we are back to the kludge of using two different sockets for pretty much the same thing. There are applications where providing a different answer on IPv6 than on IPv4 &lt;a href=&quot;http://www.kame.net/kame-mosaic.html&quot;&gt;makes sense&lt;/a&gt;&amp;nbsp;but most of the time it doesn&#39;t.&lt;br /&gt;
&lt;br /&gt;
What can we do as application developers to do things the right way the first time? That&#39;s highly language dependent. Some high-level languages don&#39;t distinguish between IPv4 and IPv6 unless you dig a little and ask specifically for it. The problem is that they may be compiled with or without IPv6 support (like ruby) and then you may be powerless to use IPv6 at all. Other languages you will need to make small adjustments (eg: C needs to use &lt;a href=&quot;http://linux.die.net/man/3/getaddrinfo&quot;&gt;getaddrinfo()&lt;/a&gt;&amp;nbsp;instead of &lt;a href=&quot;http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html&quot;&gt;gethostbyaddr()&lt;/a&gt;) Google is your friend here and be sure to checkout tools like &lt;a href=&quot;http://sourceforge.net/projects/ipv6-care/&quot;&gt;IPv6 CARE&lt;/a&gt;&amp;nbsp;which can tell you what is wrong as well as dynamically patch a running binary to do the right thing. Pretty slick!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, what is the best practice on how to listen to an IPv6 socket? My preference is to listen once and get all traffic on the one socket but there are cases where it is desirable to use two sockets. This means the best practice is to be configurable and capable of doing both. You could make me happy and default to one socket for your application though! It makes IPv6 &quot;just work&quot;.&lt;br /&gt;
&lt;br /&gt;
Thanks for reading and Happy Hacking!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/2231936938723104902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/ipv6-how-to-listen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2231936938723104902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/2231936938723104902'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/ipv6-how-to-listen.html' title='IPv6 - how to listen?'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-218913606945085008</id><published>2011-04-29T23:04:00.001-07:00</published><updated>2011-04-30T00:14:37.488-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NFS UDP"/><title type='text'>NFS over UDP, fast + cheap = not good?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;From&amp;nbsp;&lt;a href=&quot;http://imoverclocked.blogspot.com/2011/04/nfs-performance-tcp-vs-udp.html&quot;&gt;yesterday&#39;s post&lt;/a&gt;&amp;nbsp;I took off and started researching ways that NFS over UDP can go wrong. I am now sufficiently scared away from ever writing/appending files on NFS that is using UDP. There are references everywhere to potential data corruption but only a few good sources that will give me anything concrete on the topic. Those references seem to be a bit outdated but the cautious sys-admin/engineer side of me is now screaming, &quot;ok, fast + cheap somehow usually means not good.&quot;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Most of the cases I came across dealt with writing via UDP and not so much reading via UDP. There were some cache issues mentioned but we have run into those regardless of UDP/TCP so nothing new there. The particular use-case of the previous test does only need to read but in considering our general systems infrastructure we definitely need write functionality so UDP is probably not a good idea anymore.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now that the NFS path has been travelled, maybe I can find a better way?&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/218913606945085008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/nfs-over-udp-fast-cheap-not-good.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/218913606945085008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/218913606945085008'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/nfs-over-udp-fast-cheap-not-good.html' title='NFS over UDP, fast + cheap = not good?'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-4215019882646838196</id><published>2011-04-28T22:22:00.000-07:00</published><updated>2011-04-28T22:22:25.315-07:00</updated><title type='text'>NFS Performance: TCP vs UDP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I have found many places that will state that NFS over TCP is not appreciably slower on Linux unless you measure carefully. In fact, I found so many of them that I took it for granted for a while... until today.&lt;br /&gt;
&lt;br /&gt;
Here is the backstory (circa 2005):&lt;br /&gt;
&lt;br /&gt;
We are an NFS shop scaling to meet the demands of HiRISE image collection/planning/processing and we are having severe problems scaling our NFS servers to handle processing and desktop loads on our network. Turns out the final fix for some issues was to use TCP for our NFS traffic.&amp;nbsp;(BTW: thanks for the pointer from our then-in-testing-vendor, Pillar)&amp;nbsp;Ok, simple fix! Quick tests show that performance is about the same.&lt;br /&gt;
&lt;br /&gt;
Some time after this I was working with our DBA to try and speed up a process that reads a bunch of records from the database and then verifies the first 32KiB of about a half-million files that we have published via the PDS standard. I mention that we have some shiny new SunFire T1000 servers with 24 cores which could speed this effort up via threading. He takes this to heart and threads his code so each thread deals with checking a single file at once. We did get a speedup, but definitely not 24x.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ok, jump forward to the present day, literally today. I spec&#39;d some hardware and put together a 5-node cluster to virtualize a bunch of operations on. Each host has 32 cores and 128GB RAM and the particular DomU we were testing with has 24 vcpus and plenty of RAM for this task. Our NFS servers are also Sun (Oracle *cough* *cough*) servers with fancy DTrace analytics which can tell you exactly what is going on with your storage. All of this should be very capable and the network in-between is rock solid and has plenty of bandwidth... so why are we only peaking around 35 reads per second? Why is this job still taking half a day to complete?&lt;br /&gt;
&lt;br /&gt;
The network is not heavily loaded, the fileserver is twiddling its thumbs and the host has a load of about 60. I do some quick calculation and figure out that the computation is speeding along and processing a &quot;whopping&quot; 1MB of text every second (sigh.) Ok, let&#39;s point a finger at Java. It&#39;s certainly not my favorite language and as far as string processing goes, there are much better alternatives IMHO.&lt;br /&gt;
&lt;br /&gt;
I gingerly ask our DBA who wrote the code if I can peruse it to see if I see anything that could be optimized. He obliges and I peruse through the code. Of course, being an abstraction on an abstraction I&#39;m sure there is a lot to be gleaned from digging deeper but nothing pops out at me as needing to take up this entire node to process text at 1MB/s. I mention that it could be the abstractions underneath and our DBA asks why it is faster in a certain case (I haven&#39;t verified that but I believe him) and I decide, &quot;ok, let&#39;s take Java out of the equation. import python&quot; So here is the script I write to approximate his java class:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#!/usr/bin/env python&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import sys&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import threading&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import Queue&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;class read32k(threading.Thread):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;def readFileQ(self, fileQ):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;self._fq = fileQ&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;def run(self):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;while not self._fq.empty():&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;fn = self._fq.get()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;f = open(fn)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;data = f.read(32768)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;f.close()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# need to join our threads later on&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;threads = []&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# need a queue of files to look through&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;fileQ = Queue.Queue()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for arg in sys.argv[1:]:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;fileQ.put(arg)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# initialize/start the threads&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for t in range(60):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;readchunk = read32k()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;readchunk.readFileQ( fileQ )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;readchunk.start()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;threads.append( readchunk )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# wait for all threads to return&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for t in threads:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;t.join()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# note the number of files processed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;print &quot;read chunks of %d files&quot; % (len( sys.argv )-1)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
pretty brain-dead simple (and sloppy, sorry...) For the non-python coders but casually interested, the script starts 60 threads, and reads a 32KiB chunk of data from a queue of files that are passed from the command line. I invoke it as such:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;bash# time (find . -name *.IMG | xargs /tmp/test.py)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and it takes on the order of time that the java class is taking with NFS over TCP (with much less CPU usage though...)&lt;br /&gt;
&lt;br /&gt;
Ok. What gives?!? I have seen a Mac OSX host push the fileserver harder from a single threaded apps than this entire host is pushing with a multi-threaded app. Look into NFS settings, jumbo frames are enabled everywhere, nothing is popping out at me. Ok, now let&#39;s take a step back and look at the problem. No matter how many threads I use, the performance stays the same. What is it that is single-threaded and can&#39;t scale to meet these demands? It slowly occurs to me that, while TCP ensures that all packets get from client-&amp;gt;server and back, it also ensures in-order delivery of that data. I think a little further and wonder, &quot;What are the chances that people who posted these comments about NFS over TCP have ever done real parallel tests against a capable NFS server?&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRATqXXiLSzvA42BO5RZwhfUYMExYOSoAJz-lC0-mOxJDlYJJD8PtOi2fAZ9N-aA8NGre0kHW-lQUCL3XvNR0jJ4ZVlyKxI3jze24zxGl53-YcLalFXUYHbjkv7cwnur-jYoHOymFKvdE/s1600/SlowTCPOperations.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;171&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRATqXXiLSzvA42BO5RZwhfUYMExYOSoAJz-lC0-mOxJDlYJJD8PtOi2fAZ9N-aA8NGre0kHW-lQUCL3XvNR0jJ4ZVlyKxI3jze24zxGl53-YcLalFXUYHbjkv7cwnur-jYoHOymFKvdE/s320/SlowTCPOperations.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;NFS TCP Operations&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;As it turns out, they probably didn&#39;t. Above is a portion of the DTrace output from the fileserver while using TCP for NFS. The python script took 6 minutes to read over 17836 files (about 49 files per second.) Changing nothing else, below is a similar screenshot while using UDP instead of TCP.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaT2npTzHoUu6kBJEQn-LBShVNTfP2ZKgIOLEZvhiMlmPre4eYYfqb_cvA70BU7O-MZXra8lR4-uOOay7kWsB-ynYEdsVWIvqMr-lrhFk_9xDOqqzo3K1waCUnVTywjTdtl-EGpAWNTkg/s1600/FastUDPOperations.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaT2npTzHoUu6kBJEQn-LBShVNTfP2ZKgIOLEZvhiMlmPre4eYYfqb_cvA70BU7O-MZXra8lR4-uOOay7kWsB-ynYEdsVWIvqMr-lrhFk_9xDOqqzo3K1waCUnVTywjTdtl-EGpAWNTkg/s320/FastUDPOperations.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Yes, that&#39;s the whole graph. I had to use my mouse quickly enough to grab the shot before it went off the screen. The same files with a new mount using UDP instead took a total of 16 seconds. We can see that latencies are much lower but we are looking at a speedup of 22.5x. The latency differences alone do not account for this speedup. While I have not dug down deeper, I feel there may be an ability to send multiple out-of-order requests via UDP that can&#39;t be currently achieved with TCP.&lt;br /&gt;
&lt;br /&gt;
Ok, so the take-away message is: NFS over TCP can be much slower than NFS over UDP.&lt;br /&gt;
&lt;br /&gt;
Now the real work is in front of me: &quot;Can we re-implement NFS over UDP now that our network infrastructure is solid?&quot; or maybe even, &quot;Does it make sense to deal with other failure modes to gain a 22.5x improvement in speed?&quot;&lt;br /&gt;
&lt;br /&gt;
... only time will tell. Maybe we can come to the answer 22.5x faster by just implementing it across the board ;) ...&lt;br /&gt;
&lt;br /&gt;
Kidding of course! (sorta)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/4215019882646838196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/nfs-performance-tcp-vs-udp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/4215019882646838196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/4215019882646838196'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2011/04/nfs-performance-tcp-vs-udp.html' title='NFS Performance: TCP vs UDP'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRATqXXiLSzvA42BO5RZwhfUYMExYOSoAJz-lC0-mOxJDlYJJD8PtOi2fAZ9N-aA8NGre0kHW-lQUCL3XvNR0jJ4ZVlyKxI3jze24zxGl53-YcLalFXUYHbjkv7cwnur-jYoHOymFKvdE/s72-c/SlowTCPOperations.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-7751109125330557150</id><published>2010-11-10T11:53:00.000-07:00</published><updated>2010-11-10T11:53:05.241-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IPv6 smooth transition asymmetric network administrator whynot"/><title type='text'>IPv6, the new IPv4</title><content type='html'>I&#39;ve been using IPv6 since I was asked to work on a project relating to it in 2002. At the time it was a cool &quot;new&quot; protocol to play with and had some really neat auto-configuration features. I deployed it in only small limited sites where I could view the old animated IPv6 turtle. More recently I have been using IPv6 in production and have seen a lot of attempts at making political grabs on IPv6. The one that amuses me the most is the technical grab at, &quot;hey we can change things now that were problems with IPv4 before.&quot;&lt;br /&gt;
&lt;br /&gt;
I have found that the majority of the time if the problem was easy to just fix, there is a solution for it already in IPv4... with the exception of global address space of course. People like to use it as a crux and have a different network layout and rules for IPv6 than they do for IPv4. The problem is that having two distinct paths to all of your hosts and a different set of rules for each path does not create a stronger whole. At best it only stays as strong as it was and the rest of the time you are making your network weaker. By weaker I am not talking just security but usability as well.&lt;br /&gt;
&lt;br /&gt;
Security is paramount so I&#39;ll discuss this for a moment. Let&#39;s assume that we have a dual-stack network with 100 nodes. We have done our due diligence in IPv4 and have a firewall in place to make sure certain traffic does not flow, however historically the network has been open so we can&#39;t just close off all ports except the ones we know we have published. Now comes IPv6, the new historically un-used protocol... at least for this network. We have the opportunity to do things the way we want from scratch, right? Let&#39;s just close off all ports except the ones we know we publish in IPv6 and we will have a more secure network going forward! Hoorah! Wait a second, that doesn&#39;t help security because everything is still available in IPv4 and now you are managing two different rule sets for all of your services. Two different rule sets in itself is added complexity which means more room for human error.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Now, let&#39;s imagine we have a split administration for network management and host management. The network IT staff are now happy with their more secure IPv6 network and meanwhile the host IT staff are saying, &quot;ah ... finally we don&#39;t need to worry about random traffic to these hosts.&quot; From this they leave their vendor defaults of no IPv6 host based firewall while having restrictive IPv4 host based firewalls. This is essentially the opposite scheme as the network folks have taken. IPv6 is wide open while IPv4 is restricted down.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I&#39;m sure some of you white hats are starting to raise an eyebrow as you realize that any one compromised&amp;nbsp;&lt;/span&gt;host can now access all services available via IPv6 on the local lan. What you thought you had locked down in IPv4 host based firewalls is completely open under IPv6 (but only locally). You&amp;nbsp;black hats are probably thinking to yourselves, &quot;hmm, but how common is IPv6 and is it worth my while?&quot; Given that there are a lot of rogue IPv6 deployments from 6to4 routers and the fact that you could easily configure an entire network by sending out the right SLAAC packets ... as common as you want. Also, finding local IPv6 hosts is usually as easy as &quot;ping6 ff02::1&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Now that I have put most of the key ingredients out there for a really nasty worm that exploits this not-so-uncommon topology, let&#39;s talk briefly about usability. A local developer decides to deploy a service on port 8080. When he is local, his client-server connections just work because IPv6 host based or site-level firewalls are not in the way. He is also developing in a high level language so he doesn&#39;t even need to know that IPv6 is being used for this to work. Later, he goes home and tries again ... except he only has IPv4. The flow might look something like this: Ok, fair enough ... the firewall is getting in the way as usual. Time to flip on the VPN. Hmm, it&#39;s still not working? I know it was working locally when I was there and I haven&#39;t changed anything so it must be the VPN. Let&#39;s send an email to our IT staff and let them debug this wretched VPN again. Maybe I will just ask for port 8080 to be opened instead. Harrumph, another night of no progress. ~insert beer here~&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The next morning the IT staff says, &quot;Oh, he needs port 8080 opened for access from home&quot; and makes the appropriate request to the network folks. IT responds and says, &quot;OK, we opened port 8080, give it another try.&quot; The developer, waking up a little groggy decides to go to a local coffee shop to check email and get the day started. He sees the email and decides, &quot;alright, I&#39;m in a coffee shop ... I&#39;m still remote so let&#39;s test this really quickly. Hey, it works! Perfect! I can work from home tonight.&quot; Little did he know the coffee shop had an&amp;nbsp;Apple Airport which sets up 6to4 for the local clients. It worked and bypassed the host based firewall again.&lt;br /&gt;
&lt;br /&gt;
At this point I can keep iterating back and forth in this scenario and see that at least one more day goes by before anyone sits down and gets all of the glitches out of the connection process. All of this could have been avoided had all rules been held consistent between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
Now, given this one example I will say that usability is impaired and then leave it as an exercise to the reader to discover other scenarios that arise in a complicated asymmetric configuration. Solving this one problem does not solve the others. I know that sufficiently creative users manage to find all kinds of great ways in which to break the perfect models we make ... especially when we make them more complicated ... and then even more so when they don&#39;t even have to realize that more is going on below the hood than they care to know.&lt;br /&gt;
&lt;br /&gt;
The bottom line is, making IPv6 significantly different in your organization from IPv4 will invariably cause problems down the road. From a users perspective, the network should just work and not get in the way.</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/7751109125330557150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2010/11/ipv6-new-ipv4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7751109125330557150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/7751109125330557150'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2010/11/ipv6-new-ipv4.html' title='IPv6, the new IPv4'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-258719379248196401</id><published>2010-02-16T13:02:00.000-07:00</published><updated>2010-02-16T13:02:00.578-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="babble"/><title type='text'>Walking around the world -- compiling Gentoo Prefix</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Given that I&#39;m compiling Gentoo Prefix on a 2.3Ghz Linux host and it is taking several hours I started imaging how much work the computer is actually doing.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;2.3 Ghz =&amp;nbsp;2300000000 cycles per second.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Assuming we only use 10% of the CPU because we are waiting on I/O we are still talking&amp;nbsp;230000000 cycles per second.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Each cycle represents a very small operation and perhaps only 10 little operations make up some quantum of what a human would consider an &quot;operation&quot; like, &quot;take one step forward.&quot; Now we are talking about&amp;nbsp;23000000 human steps per second.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;The average human stride is perhaps 34 inches... leading to 12342 miles worth of steps per second. That means that every two seconds I am asking the computer to walk around the earth. Gentoo prefix is taking several hours to bootstrap so you can figure 3600 seconds in an hour for 3 hours equates to 5363 &quot;walks around the earth&quot; to just bootstrap prefix once.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Oops, the bootstrap just died. I need to tweak something and restart it...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Each of those lines of code has been carefully written/re-written/debugged/versioned by human hands. A person can only write so much code in their lifetime: how many lifetimes of code are flying by me every time I press enter?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/258719379248196401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2010/02/walking-around-world-compiling-gentoo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/258719379248196401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/258719379248196401'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2010/02/walking-around-world-compiling-gentoo.html' title='Walking around the world -- compiling Gentoo Prefix'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-5648565536738330487</id><published>2010-01-04T10:12:00.000-07:00</published><updated>2010-01-04T10:12:35.581-07:00</updated><title type='text'>New Years Meta-Resolution</title><content type='html'>&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Each new year brings oodles of expectations including the dreaded/coveted &quot;new years resolution.&quot; My resolution is actually a meta-resolution and it is &quot;to not need resolutions next year.&quot; If I live well enough from day to day then I don&#39;t need a special date to make my life better.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;Cheers!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/5648565536738330487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2010/01/new-years-meta-resolution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/5648565536738330487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/5648565536738330487'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2010/01/new-years-meta-resolution.html' title='New Years Meta-Resolution'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-5885386583142217829</id><published>2009-12-26T19:07:00.000-07:00</published><updated>2009-12-26T19:14:07.295-07:00</updated><title type='text'>The Physics Factory</title><content type='html'>&lt;div&gt;Home: &lt;a href=&quot;http://www.physicsfactory.org/&quot;&gt;http://www.physicsfactory.org&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;This is an interesting phenomenon with a bus-full of great demonstrations and wacky physicists who put on a great show and engage the audience with wonderful results! I spent a bit of time with the gang in the earliest days and have been pleased to see their successes grow.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It seems that they are starting to look at accomplishing one of their earlier goals of an actual Physics Factory in some way since Tucson should be on the market for something like this! &lt;a href=&quot;http://www.tucsonsciencecenter.org/&quot;&gt;Check out their progress&lt;/a&gt; and contribute if you can!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/5885386583142217829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2009/12/physics-factory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/5885386583142217829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/5885386583142217829'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2009/12/physics-factory.html' title='The Physics Factory'/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339019936960713266.post-3901205452531652265</id><published>2009-12-26T18:14:00.000-07:00</published><updated>2009-12-26T19:00:48.306-07:00</updated><title type='text'></title><content type='html'>f1r2t b10g! .. ok, maybe I&#39;m a little late in the game for that one but it&#39;s MY first anyway.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For lack of a specific topic, this will be about interesting things I come across with a small&#39;ish splash of my own thoughts. Enjoy! ;)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://imoverclocked.blogspot.com/feeds/3901205452531652265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://imoverclocked.blogspot.com/2009/12/f1r2t-b10g.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/3901205452531652265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339019936960713266/posts/default/3901205452531652265'/><link rel='alternate' type='text/html' href='http://imoverclocked.blogspot.com/2009/12/f1r2t-b10g.html' title=''/><author><name>ImOverclocked</name><uri>http://www.blogger.com/profile/12326200597531717848</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>