HNHacker News
TopNewBestAskShowJobs

jpetazzo

724 karma · joined July 26, 2010

submissionscomments
jpetazzo··on Docker - the Linux container runtime
LXC is actually the work of the OpenVZ team.

When they were tired about seeing their patches rejected from the mainstream kernel, they decided to try a different approach, and that approach is LXC. In other words, LXC is a reimplementation of OpenVZ concepts by almost the same team.

LXC is actually more secure than OpenVZ, if only because it went through more scrutiny than OpenVZ.

jpetazzo··on Docker - the Linux container runtime
dotCloud engineer here.

LXC lets you use cgroups, i.e. setup memory/cpu/IO limits per container. If you setup MySQL with more than database, you can't do that.

Also, we DO use LXC and SUPPLEMENT it by something providing security such as GRSEC (in the current version in production at dotCloud) and AppArmor (with docker) :-)

jpetazzo··on Docker - the Linux container runtime
That's correct: cgroups have no effect on permissions. They only enforce resource usage limits.

Shameless plug: I work at dotCloud, and I wrote 4 blog posts explaining namespaces, cgroups, AUFS, GRSEC, and how they are relevant to "lightweight virtualization" and the particular case of PAAS. The articles have been grouped in a PDF that you can get here if you want a good technical read for your next plane/train/whatever travel ;-) http://blog.dotcloud.com/paas-under-the-hood-ebook

jpetazzo··on Docker - the Linux container runtime
The AUFS mountpoint is also reachable from the host. However, each container uses its own `mnt` namespace, so further mounts (done within the container) will not automatically be visible.
jpetazzo··on Deploy your Go apps on dotCloud
Compiling Go code is super easy; but how easy it is to cross-compile from e.g. OS X to Linux? Or from Windows to Linux? And would there be an advantage over the current situation? (This is a genuinely naive question; I'm fairly new to Go!)
jpetazzo··on DotCloud open-sources its websocket proxy
HAProxy isn't designed to serve thousands of different virtual hosts. If you have a handful of different domains, that's fine, you can use some ACLs on the HTTP "Host:" header to differentiate them; if you have thousands of apps, and need an easy way to reconfigure dynamically, Hipache is more appropriate.
jpetazzo··on Summary of June 29 AWS Service Event in US-East
It's interesting to see that they had similar issues 2 weeks ago (power outage) and it looks like nothing was done in those 2 weeks to address the issue, since it happened again this week-end.
jpetazzo··on DotCloud updates pricing, uses new elastic pricing model
Well, it's impossible to give an universal response. It's like trying to guess how much you will pay on gas on your daily commute without knowing the distance or the kind of car you're driving.

It depends how much work is done in each "hit". If 99% of those 10k hits are to display the 10 most recent entries in a table, a very small setup will take you very far. A couple of 96 MB Python front-ends, 64 MB for SQL, you would pay maybe about $40/mo for a decent setup.

Now if most of the hits trigger complex geographic queries against a database of millions of records, with a high write/read ratio, it's a whole different story. You need to know about the size of your working set (you can then infer your database memory requirements), and have a rough idea of the average request time and concurrency (to infer your number of workers, if you're using a synchronous server like most deployments of Django or Rails).

While the "per-megabyte" price will be higher than "raw hosting", keep in mind that the granularity will allow you to do huge savings. Instead of paying for this 1.7 GB instance, you can pay for just 200 or 300 MB of RAM if that's what your app requires :-)

jpetazzo··on ZeroRPC
It's a deliberate trade-off. ØMQ itself doesn't handle HA automatically. As a client, you can create a REQ socket and connect it to multiple redundant devices. But if a device goes down, you will have to handle timeouts and repeat requests yourself. Additionally, ØMQ will not "kick out" the dead endpoint, so you will end up with 1 out of N requests timing out. So you have to add a decent amount of code in your RPC layer to make everything work properly. And you need to run ZMQ devices anyway. Running a local HAProxy with a 5 lines configuration is, IMHO, simpler than running an extra device somewhere + having to add a lot of HA-related code in the RPC layer. Of course, in the long run, it's more elegant to use XREQ + heartbeat to connect to multiple endpoints and send requests only to those which are alive. But in the short run, the HAProxy broker is dead simple and works very well :-)
jpetazzo··on Deploying Django on dotCloud - an insiders story
Btw, if people want to play with Django+MongoDB, there is this:

https://github.com/jpetazzo/django-and-mongodb-on-dotcloud

Clone the repo. Push to dotCloud. Done. You just deployed a MongoDB server and a pristine Django configured to use it :-)

jpetazzo··on Cloud deployment of PostGIS, GeoDjango, TileStream, and other geo apps made easy
We should also add other tile servers like mapserv to the mix, if there is significant demand for it! :-)
jpetazzo··on WordPress, Git-ified
There seems to be another mirror: https://github.com/dxw/wordpress

And, most disturbingly, there is also https://github.com/wordpress/wordpress, which looks more "official" but wasn't updated since about 1 year.

It would be awesome if WordPress would publish the official stuff under the wordpress github account - there would be less confusion, IMHO.

jpetazzo··on SSL session caching in nginx
I guess that it's not easy to implement session affinity on the SSL level. You cannot access information like cookies or other HTTP headers (since they are inside the SSL payload that you're trying to handle). So you have to use the little information you have: source IP address and port, and session data.

The idea would be to make sure that a given client is always sent to the same SSL handler.

We could imagine having two layers of load balancers: - first layer would use source IP address and/or session data to determine to which server of the second layer the connection should be forwarded; - second layer would receive the connection and to the proper SSL handling.

I believe that this would work, but it seems that it would require a custom "half-implementation" of SSL on the first layer of load balancers. I don't know if there is any provision for that in OpenSSL or GNUTLS. Also, since there are already hooks to do session caching in most SSL-enabled servers, using those hooks to plug in a memcached backend seems to be less "disruptive" (read "easier to understand, implement and debug").

jpetazzo··on All-You-Can-Watch MoviePass Brings Netflix Model to Theaters
Same in France since years. There are a few big theatre chains; if I remember correctly, at least 2 of them have an "unlimited" card. The UGC[1] one is 20 EUR/month (~30 USD), which is roughly the price of 2 tickets. A lot of people subscribe to the card, and then watch stuff that they would not have watched otherwise — and they are generally happy with it. I cannot tell if they really find the movies interesting, or if they are just rationalizing their experience and refusing to consider the subscription as a waste :-)

[1] http://www.ugc.fr/typepage.do?alias=carteugcillimite

jpetazzo··on DotCloud releases support for Perl, aka Camel-as-a-Service
Hi,

Well, actually, we didn't pickup Plack from its author. When people started asking about Perl, we just replied with another question: "which framework? how? what?", and we tried extract the most common denominator.

The vast majority told us about Mojolicious, Dancer and Catalyst. There seemed to be a pattern :-)

Regarding the server interface, a lot of people seems to agree over Plack. We were the ones asking "hey, what about FastCGI?" - since I personally never had met Plack before. We were shown the Plack::*::FCGI modules and thought "okay, that seems cool".

Then we had a look at the server options. We had already used UWSGI for the Python stack, and UWSGI has a PSGI module. Some might say that it's a bit experimental, but the authors are awesome people, always willing to fix bugs as fast and efficiently as possible.

Of course, the author of Plack helped us to get everything straight - but paradoxally, he was also the one pointing us to cpanm, perlbrew and basic stuff like Makefile.PL.

Now, to get back to you: what does your app look like? We would like to help and see how we can get it to run on DotCloud!

jpetazzo··on How I deployed my Django app onto DotCloud
Hi, DotCloud'er here! Those timeout errors are pretty common, and we are working very hard to reduce them. Almost all operations should be idempotent - meaning that you can repeat them without any danger. Basically: if the 1st time didn't work, the 2nd time will do; if the 1st time did work, the 2nd time won't do anything.

We got a fairly massive growth, and a lot of internal components required to be upscaled much earlier than planned. As we rewrite, optimize, and weed out bugs out of thos components, the timeouts will disappear, and the platform will be faster as a whole.

Just so you know - we are using the "eat your own dog food" principle as much as possible. API, website, docs... are all using the DotCloud platform itself, and we generally don't need escalated privileges to debug stuff. I think we need to be more explanatory about the various ways to inspect logs and debug code, since there is a lot more than meets the eyes :-)

I'm curious about how you feel that we are "more restricted than the Heroku environment"; I would really feel compelled to fix it in any case!

All the best,

jpetazzo··on How I deployed my Django app onto DotCloud
Hi, DotCloud'er here - so take my comment with a bit of salt :-)

Regarding "lack of control", we do our best to address that, in multiple ways.

1. We don't require DotCloud-specific changes to your apps; if you install your Python dependencies with pip or easy_install, dropping a requirements.txt file at the top of you app will be enough to get them installed automatically when you push your code to DotCloud. Of course, if you are used to install Python stuff with other ways (apt-get install, or funky PYTHONPATH tricks), you will have to change that. But moving your dependencies to requirements.txt is not DotCloud-specific, and if you take the time to do it, your app will certainly run better, not only on DotCloud, but on other environments as well. Same thing for the wsgi.py wrapper: once you have done that, you app will run like a charm on any other WSGI-compliant hosting. We think it's a big win, but we won't fight to the death to convince you otherwise ;-)

2. We give a "fair amount" of control on your DotCloud services: SSH, crontabs... But you don't get root access. Why? Well, what if you deploy a Python+WSGI service, and then "sudo apt-get install redis mysql-server irb1.8"? If we want the scaling/monitoring/etc. to be working, we need to set some rules. However, if you need custom stuff, we will always do our best so you can get them.

3. There's the famous "I'm too scary to put my data in the Cloud" (especially after last week's EC2 outage); we address that by giving you many ways to setup automatic backups of your data. For instance, we have a tutorial explaining how to setup MySQL/PostgreSQL backups and ship them to a 3rd party server using FTP/SCP.

We are perfectly aware that many of you out there can do what we do with Puppet/Chef/#{my_fav_devops_tool}, but there are even more people who would rather get straight to the code, and we want them to be as happy and productive as possible!

jpetazzo··on Working around the EC2 outage
Amazon promised that regions wouldn't see two zones going down at the same time. That's totally different, and that's what happened today.
jpetazzo··on Working around the EC2 outage
Well, US East (North Virginia) is actually 4 datacenters. As pointed out in the article, multiple availability zones (=multiple datacenters) are affected by the outage, meaning that even if you deploy on multiple datacenters, you can go down.

Now, if you're talking about deploying to e.g. both US East and US West, I totally agree: it would be a good thing to do. But EC2 does not give you that option - not easily, at least, because there is no convenient way to move volumes or snapshots between regions.

Setting up HA between close datacenters (e.g. 50 miles from each other) is easy, because the latency remains low. Setting up HA between datacenters coast to coast is a whole different story, and the only help brought by EC2 is the fact that you can use the same API to deploy your machines here and there.

jpetazzo··on DotCloud gets NodeJS support
You're totally right. Following your advice, I added a little note to the docs. I hope it will clear up any doubt!
jpetazzo··on DotCloud gets NodeJS support
"Yes you can!"

Sorry if that's not very clear; but although your app has to run on port 8080, it will be reachable through (e.g.) http://nodechat.ramen.dotcloud.com/ (after bouncing through half a dozen internal proxies, load balancers, discarded Otto's toys, and other funky stuff that you don't want to hear about).

jpetazzo··on Phpfog "Down for maintenance"
I don't think they are obfuscating it. If I remember correctly, their pricing page made perfectly clear that they used dedicated EC2 instances.

Just for the record - the cheapest EC2 instance type is t1.micro, and amounts to ~15 USD/month (+EBS and IP costs). I didn't see their business plan so I can't tell what is their big picture about that :-)

jpetazzo··on Ron Conway, Chris Sacca And Others Invest 800K In Dotcloud (YC S10)
Elastic BeanStalk only does Java so far, or so I guess. Sure, they will expand - Amazon has an awesome R&D so I don't expect them to stay sitting there. And if you're daring, you can probably already run JRuby and Jython on BeanStalk, but YMMV. DotCloud already has Python, Ruby, PHP, Java, MySQL, PostgreSQL, Redis... The CLI is also quite easier to use than Boto. It doesn't need you to learn everything about instances, EBS, ELB, etc. for starters :-) Finally, I like Chef/Puppet, but mastering them takes some time. And most folks prefer pushing your code with git/hg (à la Heroku/Djangy/etc) rather than authoring AMIs, I was told :-)
← PreviousPage 3 of 3