Hacker Newsnew | comments | show | ask | jobs | submitlogin
Youporn.com is now a 100% Redis Site (groups.google.com)
456 points by potomak 879 days ago | comments


antirez 879 days ago | link

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.)

-----

Mikushi 879 days ago | link

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.

-----

hello_moto 878 days ago | link

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?)

-----

alanh 878 days ago | link

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

-----

badboy 879 days ago | link

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

-----

pud 879 days ago | link

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.

-----

traskjd 878 days ago | link

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!

-----

mahmud 878 days ago | link

You prude!

-----

mhurron 878 days ago | link

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

-----

leviathant 878 days ago | link

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

-----

wonster 878 days ago | link

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.

-----

junto 878 days ago | link

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

-----

vacri 878 days ago | link

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

-----

brettz 878 days ago | link

Spankwire is alexa top400 and runs in .NET

-----

d3x 878 days ago | link

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

-----

baby 878 days ago | link

But they're unknown.

-----

d3x 878 days ago | link

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

-----

thezilch 879 days ago | link

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

-----

itmag 878 days ago | link

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

-----

roc 878 days ago | link

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.

-----

itmag 878 days ago | link

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.

-----

Helianthus 878 days ago | link

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

-----

rev087 878 days ago | link

Which make the concept of war even more obscene.

-----

roc 878 days ago | link

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.

-----

fluidcruft 878 days ago | link

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.

-----

itmag 878 days ago | link

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...

-----

Dylan16807 878 days ago | link

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.

-----

hnal943 878 days ago | link

Don't forget games! http://en.wikipedia.org/wiki/Space_Travel_%28video_game%29

-----

pellias 879 days ago | link

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

-----

gaius 879 days ago | link

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.

-----

anamax 878 days ago | link

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.

-----

mun2mun 879 days ago | link

Relevant http://www.pcworld.com/article/155745/thank_you_porn_12_ways...

-----

GrumpySimon 878 days ago | link

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.

-----

jgw 878 days ago | link

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.

-----

saraid216 878 days ago | link

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.

-----

roc 878 days ago | link

As well as advertising networks and referral schemes.

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

-----

keypusher 878 days ago | link

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

-----

dchuk 878 days ago | link

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

-----

roc 878 days ago | link

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.

-----

wisty 878 days ago | link

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.

-----

Spearchucker 878 days ago | link

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

-----

thezilch 879 days ago | link

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.

-----

antirez 879 days ago | link

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

-----

cicloid 878 days ago | link

All in the name of science!

-----

StavrosK 879 days ago | link

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?

-----

thezilch 878 days ago | link

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.

-----

StavrosK 878 days ago | link

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

-----

awj 878 days ago | link

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

-----

shykes 878 days ago | link

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.

-----

sanswork 879 days ago | link

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

-----

StavrosK 878 days ago | link

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

-----

chubot 878 days ago | link

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.

-----

eric-hu 878 days ago | link

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.

-----

memoryfault 878 days ago | link

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

-----

n_time 878 days ago | link

...

-----

siculars 878 days ago | link

Don't travel to Iran.

-----

johnx123-up 878 days ago | link

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

-----

pavelkaroukin 878 days ago | link

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

-----

povilas 878 days ago | link

No. It is PHP. https://groups.google.com/d/msg/symfony-devs/WGMooRPjmEY/hwW...

-----

pavelkaroukin 874 days ago | link

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.

-----

webda2l 872 days ago | link

Symfony2 rocks

-----

rhizome 878 days ago | link

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..

-----

jarin 878 days ago | link

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.

-----

RandallBrown 879 days ago | link

For some reason I always imagine porn sites to be run by guys in cheap suits and lots of hair gel. Then I realize that in order to run a site with the kind of traffic that some of them have, you really need to have some decent engineers on staff.

-----

jwr 879 days ago | link

You'd be surprised if you went to meetings with porn business companies in Japan. Stylish offices, elegant suits, great manners, no hint of actual porn anywhere. In fact, you could easily confuse the office with an investment bank.

-----

arethuza 879 days ago | link

I once had a surreal meeting with a hotel chain where they mentioned they had detailed management reports on stuff like the average time films are watched for and that they had a graph showing how long porn movies are watched for.

This was all being discussed in the context of a fairly formal business meeting.

-----

geoffw8 878 days ago | link

I used to work with a company who provide most of the network/software/hardware for hotels/airports/tran stations/lobbies around the world.

Some very interesting insights from the hotels side of things.

-----

DavidChouinard 878 days ago | link

Care to share?

-----

geoffw8 875 days ago | link

Wish I still had the data on hand - as you would imagine - mostly porn.

-----

nooneelse 878 days ago | link

Ok, I'm feeling rather naïve and waking up slowly this morning. Why do they care to know that? I mean, what about their business does that help them improve? Because, I think we can take it somewhat for granted that such information probably isn't something which the individuals involved, their customers in this situation, enjoy knowing is being collected about them. "Hey, you know that activity you probably consider rather private, we like to record everything about it we easily can, because umm... customer service."

If I kept track of the porn watching habits of my neighbors, that would be considered strange and maybe rather pervy. And I don't see how it makes a difference in that evaluation whether they are or aren't renting the tv they use from me.

-----

simcop2387 878 days ago | link

It probably lets them know how long the movies they produce should be. If it's too long before any action is in there then people move on. If it's not long enough then the customer doesn't get what they want. Optimizing this means that they can take a single 8 hour shoot, that'll produce maybe an hour and a half of good footage (just pulling numbers out of my ass) and make more than one video of the right length to get the most profit out of it.

-----

nooneelse 878 days ago | link

Ok, thanks, I'm restored to cynical now... and the business advantage to be found here is that they can go even further than just optimizing length to match what people want, they can make them just a bit shorter than more people would like, so people will buy two instead of just one.

-----

HeyLaughingBoy 878 days ago | link

It's probably an extra-cost service to the hotel guest. The hotel wants to know how much/how often the service is used so they can optimize it for their needs. No sense paying for more bandwidth than you need.

In any case, they probably have no need for individual statistics: the aggregated watching habits of guests is enough to provide useful information.

-----

borism 878 days ago | link

Well, they almost ARE an investment bank. They've commoditized sex and are now trading it.

-----

pjscott 878 days ago | link

In that sense, a company that makes any commodity, like toilet paper or aluminum cans, is "almost" an investment bank.

-----

Alex3917 878 days ago | link

"For some reason I always imagine porn sites to be run by guys in cheap suits and lots of hair gel."

Pretty much the exact opposite actually. Porn industry guys tend to be 30 - 40 on average and super cool and laid back, though in an LA sort of way. I'm sure there's a lot of crap going on beneath the surface, but at least from the outside it seems like a much nicer work culture than silicon valley.

-----

antirez 879 days ago | link

Sure, not only there is huge traffic, they also generate tons of money, so porn sites are definitely not second citizens in the web from a technical point of view.

-----

thomasbachem 878 days ago | link

The owner of YouPorn (and many others) is Fabian Thylmann, and he is actually a geek at heart: http://nymag.com/news/features/70985/index4.html (article) http://www.cnbc.com/id/45989405/Meet_the_New_King_of_Porn (photo)

-----

Uchikoma 878 days ago | link

I still talk about your excellent open PHP presentation in Hamburg, I'm still impressed #smallworld

-----

rayhano 878 days ago | link

Looks like YC needs a new Request For...

-----

rplnt 879 days ago | link

Some time ago I've read an IAmA on reddit with staff member of some big porn portal. It was quite interesting but I don't remember what porn site it was and don't want to blindly trying to google it as I'm at work. Writing this in case anyone knows and would post it here :)

-----

Mikushi 879 days ago | link

I did this IAmA couple month back : http://en.reddit.com/r/IAmA/comments/kf4be/nsfw_iama_former_...

And i am happy that my months of lobbying for Redis at the office paid :D

-----

zalew 879 days ago | link

http://sl.reddit.com/r/IAmA/comments/htn7x/i_run_porntubecom...

the guy from pinklab http://www.pinklab.com/reddit.html talked around there, but can't find the link. there were also some others, even a guy who ran a 2g1c kind of site.

-----

thamer 879 days ago | link

An ex-PornHub developer did an AMA a few months ago; they were using Redis as well: http://www.reddit.com/r/IAmA/comments/kf4be/nsfw_iama_former...

-----

clu3 879 days ago | link

First off, I am not saying that youporn guys are not decent but IMHO, people shouldn't get too excited about this.

Youporn is somewhat quite a simple site I'd imagine. It's just categorized videos with a bunch of stats (views, related video...), and users. There's almost no social interaction between users (i've just registered an account just to confirm that).

That's a very clear (and good) reason why 100% redis suits for this website, apart from the goodness of redis like sorted sets are perfect for the "top rated" or "being watched" sections

Imagine the site now wants to add a little bit of social interaction, like allowing users to post video, follow each others... I'd say 100% redis wouldn't work any more

-----

asto 879 days ago | link

Imagine the site now wants to add a little bit of social interaction, like allowing users to post video, follow each others

Follow each other? I'm not sure you know what the point of a porn website is.

-----

clu3 878 days ago | link

I'm pretty sure i know what I'm looking for in a porn site. There's many things youporn can do to help me watch better stuff.

Say I'm a fan of a porn star XXX and I'd like to see a simple notification that there's recently a new video tagging her. Same thing if I like some particular user's taste for porn and would like to get noticed if he/she has posted a video. Basically if it gets more social, my wall or dashboard or whatever, would be more sorta relevant.

-----

raphman 879 days ago | link

Imagine the site now wants to add a little bit of social interaction, like allowing users to post video

As far as I know, Youporn is all about users posting videos (whereby amateur porn is probably only a small part of all uploads, I guess)

-----

CWIZO 878 days ago | link

You would imagine wrong. I'm running a video sharing page (think FB&youtube mashed together with a dash of blogger) with about 800k unique/month users and it's no picnic.

-----

lmm 878 days ago | link

Sure, but the sharing is what makes it hard - as soon as your pages are per-user it gets interesting. For youporn, each video page is essentially static (maybe there are comments? Even if there are, I doubt they display a different set of comments to each /viewer/). So video pages are easy to cache, the database layout is simple, and sure there's some effort involved in scaling up but it's nowhere near as hard as e.g. tumblr's architecture that was featured recently (where every viewer sees a page with all the posts from everyone they're following, and so everyone's page is different)

/briefly worked at last.fm

-----

hello_moto 878 days ago | link

Do you store the video using some sort of distributed file systems? specialized machine? SAN/NAS?

Or the good old' NFS?

-----

CWIZO 878 days ago | link

Nothing fancy actually. We have 3 dedicated storage servers (two in the same DC as our web server, one in germany), with lots and lots of disk space. We then SCP converted videos to them and serve them trough nginx (supports seeking).

-----

hello_moto 878 days ago | link

Hey, thank you so much for the information. I hope you don't mind to share a little bit more (it's okay if you don't reply due to IP or whatnot, I'll understand).

How do you handle where to put the files on which disks? do you write custom software or there's some sort of off-the-shelf software to do this?

The reason I asked about this is because it looked like a few people I talked to seem to prefer to use Distributed File System such as HBase, GlusterFS or something else so that they don't have to write extra code.

And I'm guessing you back them all up on daily base as well?

-----

CWIZO 878 days ago | link

We split files into two levels of folders. For instance if a video has a filename "somethingsomethingXY" it will go into "videos/y/x/" folder. Then it's up to our sys admins to mount those folders to whichever disk they want. So from the app's point of view it doesn't matter where the file actually is. And we backup everything every couple of hours.

Like I said, nothing fancy but it works without any issues (apart from a small delay when you have to copy the file to 2 or 3 different servers (redundancy) before it becomes available, but it's not a big problem but I have few ideas how to solve that if it becomes one :)).

-----

hello_moto 877 days ago | link

Thank you very much for sharing this.

Wish you all the best to hit and solve that problem (meaning you'll be successful by that time I'm guessing (^_^)).

-----

clu3 878 days ago | link

I apparently did NOT say that it's picnic. And I don't see how your reply is related to my comment. Does your site have enough social features? Like follow, walls... And is your site 100% redis too?

-----

CWIZO 878 days ago | link

I was just stating that building a site like that is not as trivial as you made it out to be. Yes you "only" have some videos, but you also have views of said videos, and comments and rankings. Building different views of videos based on those factors is hard if you have lots and lots of this data points. Not to mention that you then have to (somewhere) display just some user's videos sorted by how they ware ranked, or maybe just some user's videos from some category based on number of views (which is not a simple INT field in the db). Etc etc etc.

What I'm saying is that there is more than it meets the eye.

-----

More



Guidelines | FAQ | Lists | Bookmarklet | DMCA | News News | Bugs and Feature Requests | Y Combinator | Apply | Library | Contact

Search: