Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's porn for database geeks: 100 million pageviews per day, 300k requests per second against Redis.

The way they use MySQL is also interesting IMHO: they populate a relational database in order to be able to build new indexes in the Redis side, using the relational DB for the stuff it is best at, generating new "views" of the data easily.

(Relational DBs are also good to do a zillion more things of course.)



Yep, i've been a Redis lobbyist for over a year at this company (i use to be the Lead Software Engineer on Youporn/Pornhub), and i'm really happy to see them using it and using it properly.


How do you store the videos?

I remember seeing YouTube storing videos using some sort of specialized hardware from NetApp or something and they still got hit by the limitation of Linux filesystem (number of nodes?)


It was number of files in a directory, and those were the garage days.


You know your software is successful when it's used by porn sites :D


I remember in the 90's having a conversation with my friend. We were discussing Linux vs Windows for web hosting. My friend said "tell me if you can find a single porn site that's hosted on Windows." He was right, I couldn't find any.


They do exist. I run a .NET developer tools company and had a customer purchase our data access products to use with several of their porn sites.

Never did manage to see the final product though!


You prude!


Worked for one that was at least in the top 5 porn sites back around 1998-99. All Windows servers running IIS and we were using NetApp appliances for storage.


How long did you spend on this "research" out of interest? :-)


Hard to say. The research was done in short bursts.


They do exist. I turned down the chance to interview at one about 6 months ago.


Sure, but IIS in 2011 is a completely different beast than IIS in the 90s.


Spankwire is alexa top400 and runs in .NET


AEBN was and might still be the largest VOD service online and they run Windows or at least they did while I was there.


But they're unknown.


Actually they are very well known. They are one of the largest adult companies on the web.


VHS, Linux, and now Redis; the webscale race is over!!


Porn and war drive all innovation. Or so they say.


Sex and war would seem more accurate; porn being just a subset of sex.

And I suppose one could argue that war is often just a manifestation of a desire for sex or power/money as an intermediary to sex.


Reading tip for you: Prometheus Rising by Robert Anton Wilson. Especially the part about the first 4 primitive circuits of the mind which govern survival, dominance, sex, stuff like that. War is very centered on Circuit II: dominance, emotions and territorial thinking.

http://www.wikisummaries.org/Prometheus_Rising

It fucked my mind when I read it :) It's a bit far out sometimes though, but it's a cool read.


It's even less scientific than Freud, and I regard Freud as much as speculation as science. At least Freud had case studies. :/


Which make the concept of war even more obscene.


If you feel that sex is obscene, perhaps.

Edit: Otherwise I don't see what the goal does to make the butchery of your fellow man any more or less obscene than it inherently is.


I assumed he was gesturing at the creation/destruction discord inherent in sex/war with war being the referent for obscene. Of course, a full account of sex more than kisses and pleasantries, it also involves competition.


The (oftentimes sublimated) drive to procreate is one of the most powerful drivers of all human society and action. Perhaps even THE "primus motor" behind it all.

In Prometheus Rising RAW mentions that the reason monks take a vow of chastity is because it instantly frees them from one of the major hamster-wheels of the human condition.

Of course, I'm not planning to become a monk :) But food for thought...


Allow me to explain the joke.

The legal definition of obscenity requires that a work is meant to be arousing and has patently offensive sexual conduct, in addition to having no redeeming artistic value.

Therefore, adding sex into something offensive makes it more obscene.



I was afraid to see what youporn is (at work now), so i guess it is really a porn site.


The online porn industry were the first people to really deal with scalability (of managing and serving web content, anyway), the first people to deal with online payments, the first people to come under really heavy, sustained hacking attempts, etc. Don't underestimate how much of what you take for granted technologically in 2012, they pioneered in the mid-90s.


A friend of mine built a lot of porn sites in the late 90s using DB2 and Oracle. He says that Microsoft's SQL Server folks came to him to talk about what it would take to get him (and the porn sites) to use SQL Server.

He said that he was confident that DB2 and Oracle could handle the load. They responded that SQL Server was much more capable than he thought and asked him about the workload.

Their response to his answer was "we can't even simulate that, maybe we're not ready".

I assume that they got better.



It's not just now either, the porn industry was hugely influential in causing the adoption and spread of video (you know, on casette), movies and photography.


Indeed - I've heard it argued that the real reason that VHS won out over the technically superior Betamax format, was that Sony refused to license the Betamax technology to adult video vendors. Never dug into it, but it seems plausible.


Having just one deciding factor seems implausible. Straw that broke the camel's back? Sure. But calling it "the real reason" completely ignores every other relevant factor.


They were also first at SEO - all of these sites competing for the same words - "sex" and "fuck" being their holy grail.


As well as advertising networks and referral schemes.

Though, oddly, they've been late to the game on social.


Scariest button on a porn site is the Like/G+ button.


Social took off when Zuck tricked users into giving out their real names, when meant social networks grew much faster (as old school friends would connect).

Porn does "social", but only anonymous social, which is naturally handicapped.

If someone created a social network which allowed better privacy controls, the porn sites would love it.


porn is invariably a "solo" endeavor 99.9% of the time


And yet a significant amount of money is being made by services whose natural market maps directly onto the porn site viewing market.

reviews, 'discreet' dating sites, sugar-daddy match-making sites, etc.


We do the same thing, where we populate a mysql store as a secondary storage for business intelligence -- our Founder, PM, AdOps, etc know enough SQL to be dangerous if we build out more traditional, relational models.

It amused me that you were testing a porn site -- the homepage / potentially-misused zrange-issue.


I had to test if it was truly fast...


All in the name of science!


300k requests/sec? Surely that can't be on a single Redis server, is it? Is Redis cluster out yet, or did they implement their own?


Redis can run anywhere from 50-200K IOPs, on a single core, dependent on CPU; you can find benchmarks at the following:

    * http://code.google.com/p/redis/wiki/Benchmarks
    * http://redis.io/topics/benchmarks
At the point where multi-core sharding/ring setups are involved, you begin to have NIC/network saturation. It's feasible to achieve 300K on a single box.


That's amazing, thank you. This would make me want to use redis for everything, if I weren't already using it for everything.


The OP actually addresses this. They're doing some form of clustering and had to add more nodes due to network saturation.


Just to clarify, they're using regular master-slave, as opposed to "clustering" which is an unreleased feature.

I love how they use sInterStore as a replacement for a fat SQL query.


It would be mostly reads so could be done with lots of slaves and sharding without redis cluster.


Very true, but now I wonder how many reads/sec each of those servers pushed.


100M page views per day is 1157 page views per second. I wonder how that's being blown up by a factor of 300?

I suppose if each video's metadata causes a redis lookup and there are 300 videos displayed per page that would do it, but you'd think you could batch those lookups. It seems a fairly inefficient.

Either that or they have some background jobs causing redis lookups that aren't a result of page views.


There's 30 videos on the front page. Mousing over the image preview of a video displays a series of preview images.

There were 76 requests made as observed from the net tab in Firebug. The majority of these requests seemed to be for those video images. Note that I'm using an adblocker and refuse to check out the site without it.

Note also that they said 300k queries. There could be constantly-running background jobs doing conversion, pulling those preview frames, and crunching numbers on the metadata.


Perhaps the 300k/s figure was at peak load.


...


Do they use any sort of wrapper or architecture around it? Is it in Ruby, BTW?


AFAIK, it is Perl project. And I remember seeing it showcased at Catalyst website, so it likely built on top of Catalyst Framework



Thanks.

  Tomorrow our site, with over 100 million page views per day, will be relaunching running on Symfony2.  This is a complete rewrite.  Prior to that it was running the Catalyst Engine written in Perl.


Symfony2 rocks


Sounds like Redis is being put to the role of reader boxes in the older split-head MySQL (or *SQL) architecture "write to master, read from slaves" with a conversion shim between MySQL & Redis..


I'm doing something similar with Dirty Hot Productions (one of my clients). We use MySQL on a separate CMS Rails app to store everything, and all of the websites communicate with the CMS via an API. We use Redis to cache all of the API responses, so effectively everything except the first read (or the first "dirty" read) on a particular query is coming straight from Redis. It works amazingly well, and it doesn't use nearly the amount of RAM I thought it would.


Don't travel to Iran.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: