Friday, 25 February 2011

To all those comment spammers

Please just stop it. It's anoying to edit your spam comments every day, every hour. I am very sick and tired of you, and your adult websites or other s**t. Simply put, I AM NOT INTERESTED to approve your comment if it has been made by bots or by insensible jerks like yourself (i am reffering of course to the spammers). I gave you a free advertisment page and that's how you repay me? Selfish idiot no-lifers. It is no use to spam my blog because it won't work. And you will soon realise that by doing this you prove just how selfish and no-lifer you are. I know you got the point of this. Get the hell out of my blog or shoot yourself with a magnum. Thanks

Manager.

Wednesday, 15 December 2010

Youtube architecture

Update 2: YouTube Reaches One Billion Views Per Day. That’s at least 11,574 views per second, 694,444 views per minute, and 41,666,667 views per hour.
Update: YouTube: The Platform. YouTube adds a new rich set of APIs in order to become your video platform leader–all for free. Upload, edit, watch, search, and comment on video from your own site without visiting YouTube. Compose your site internally from APIs because you’ll need to expose them later anyway.

YouTube grew incredibly fast, to over 100 million video views per day, with only a handful of people responsible for scaling the site. How did they manage to deliver all that video to all those users? And how have they evolved since being acquired by Google?

Information Sources



  1. Google Video


Platform



  1. Apache

  2. Python

  3. Linux (SuSe)

  4. MySQL

  5. psyco, a dynamic python->C compiler

  6. lighttpd for video instead of Apache


What’s Inside?


The Stats



  1. Supports the delivery of over 100 million videos per day.

  2. Founded 2/2005

  3. 3/2006 30 million video views/day

  4. 7/2006 100 million video views/day

  5. 2 sysadmins, 2 scalability software architects

  6. 2 feature developers, 2 network engineers, 1 DBA


Recipe For Handling Rapid Growth


while (true)
{
identify_and_fix_bottlenecks();
drink();
sleep();
notice_new_bottleneck();
}


This loop runs many times a day.

Web Servers



  1. NetScalar is used for load balancing and caching static content.

  2. Run Apache with mod_fast_cgi.

  3. Requests are routed for handling by a Python application server.

  4. Application server talks to various databases and other informations sources to get all the data and formats the html page.

  5. Can usually scale web tier by adding more machines.

  6. The Python web code is usually NOT the bottleneck, it spends most of its time blocked on RPCs.

  7. Python allows rapid flexible development and deployment. This is critical given the competition they face.

  8. Usually less than 100 ms page service times.

  9. Use psyco, a dynamic python->C compiler that uses a JIT compiler approach to optimize inner loops.

  10. For high CPU intensive activities like encryption, they use C extensions.

  11. Some pre-generated cached HTML for expensive to render blocks.

  12. Row level caching in the database.

  13. Fully formed Python objects are cached.

  14. Some data are calculated and sent to each application so the values are cached in local memory. This is an underused strategy. The fastest cache is in your application server and it doesn’t take much time to send precalculated data to all your servers. Just have an agent that watches for changes, precalculates, and sends.


Video Serving


  • Costs include bandwidth, hardware, and power consumption.

  • Each video hosted by a mini-cluster. Each video is served by more than one machine.

  • Using a a cluster means:
    - More disks serving content which means more speed.
    - Headroom. If a machine goes down others can take over.
    - There are online backups.

  • Servers use the lighttpd web server for video:
    - Apache had too much overhead.
    - Uses epoll to wait on multiple fds.
    - Switched from single process to multiple process configuration to handle more connections.

  • Most popular content is moved to a CDN (content delivery network):
    - CDNs replicate content in multiple places. There’s a better chance of content being closer to the user, with fewer hops, and content will run over a more friendly network.
    - CDN machines mostly serve out of memory because the content is so popular there’s little thrashing of content into and out of memory.

  • Less popular content (1-20 views per day) uses YouTube servers in various colo sites.
    - There’s a long tail effect. A video may have a few plays, but lots of videos are being played. Random disks blocks are being accessed.
    - Caching doesn’t do a lot of good in this scenario, so spending money on more cache may not make sense. This is a very interesting point. If you have a long tail product caching won’t always be your performance savior.
    - Tune RAID controller and pay attention to other lower level issues to help.
    - Tune memory on each machine so there’s not too much and not too little.

  • Serving Video Key Points



    1. Keep it simple and cheap.

    2. Keep a simple network path. Not too many devices between content and users. Routers, switches, and other appliances may not be able to keep up with so much load.

    3. Use commodity hardware. More expensive hardware gets the more expensive everything else gets too (support contracts). You are also less likely find help on the net.

    4. Use simple common tools. They use most tools build into Linux and layer on top of those.

    5. Handle random seeks well (SATA, tweaks).


    Serving Thumbnails


  • Surprisingly difficult to do efficiently.

  • There are a like 4 thumbnails for each video so there are a lot more thumbnails than videos.

  • Thumbnails are hosted on just a few machines.

  • Saw problems associated with serving a lot of small objects:
    - Lots of disk seeks and problems with inode caches and page caches at OS level.
    - Ran into per directory file limit. Ext3 in particular. Moved to a more hierarchical structure. Recent improvements in the 2.6 kernel may improve Ext3 large directory handling up to 100 times, yet storing lots of files in a file system is still not a good idea.
    - A high number of requests/sec as web pages can display 60 thumbnails on page.
    - Under such high loads Apache performed badly.
    - Used squid (reverse proxy) in front of Apache. This worked for a while, but as load increased performance eventually decreased. Went from 300 requests/second to 20.
    - Tried using lighttpd but with a single threaded it stalled. Run into problems with multiprocesses mode because they would each keep a separate cache.
    - With so many images setting up a new machine took over 24 hours.
    - Rebooting machine took 6-10 hours for cache to warm up to not go to disk.

  • To solve all their problems they started using Google’s BigTable, a distributed data store:
    - Avoids small file problem because it clumps files together.
    - Fast, fault tolerant. Assumes its working on a unreliable network.
    - Lower latency because it uses a distributed multilevel cache. This cache works across different collocation sites.
    - For more information on BigTable take a look at Google Architecture, GoogleTalk Architecture, and BigTable.

  • Databases



    1. The Early Years
      - Use MySQL to store meta data like users, tags, and descriptions.
      - Served data off a monolithic RAID 10 Volume with 10 disks.
      - Living off credit cards so they leased hardware. When they needed more hardware to handle load it took a few days to order and get delivered.
      - They went through a common evolution: single server, went to a single master with multiple read slaves, then partitioned the database, and then settled on a sharding approach.
      - Suffered from replica lag. The master is multi-threaded and runs on a large machine so it can handle a lot of work. Slaves are single threaded and usually run on lesser machines and replication is asynchronous, so the slaves can lag significantly behind the master.
      - Updates cause cache misses which goes to disk where slow I/O causes slow replication.
      - Using a replicating architecture you need to spend a lot of money for incremental bits of write performance.
      - One of their solutions was prioritize traffic by splitting the data into two clusters: a video watch pool and a general cluster. The idea is that people want to watch video so that function should get the most resources. The social networking features of YouTube are less important so they can be routed to a less capable cluster.

    2. The later years:
      - Went to database partitioning.
      - Split into shards with users assigned to different shards.
      - Spreads writes and reads.
      - Much better cache locality which means less IO.
      - Resulted in a 30% hardware reduction.
      - Reduced replica lag to 0.
      - Can now scale database almost arbitrarily.


    Data Center Strategy



    1. Used manage hosting providers at first. Living off credit cards so it was the only way.

    2. Managed hosting can’t scale with you. You can’t control hardware or make favorable networking agreements.

    3. So they went to a colocation arrangement. Now they can customize everything and negotiate their own contracts.

    4. Use 5 or 6 data centers plus the CDN.

    5. Videos come out of any data center. Not closest match or anything. If a video is popular enough it will move into the CDN.

    6. Video bandwidth dependent, not really latency dependent. Can come from any colo.

    7. For images latency matters, especially when you have 60 images on a page.

    8. Images are replicated to different data centers using BigTable. Code
      looks at different metrics to know who is closest.


    Lessons Learned



    1. Stall for time. Creative and risky tricks can help you cope in the short term while you work out longer term solutions.

    2. Prioritize. Know what’s essential to your service and prioritize your resources and efforts around those priorities.

    3. Pick your battles. Don’t be afraid to outsource some essential services. YouTube uses a CDN to distribute their most popular content. Creating their own network would have taken too long and cost too much. You may have similar opportunities in your system. Take a look at Software as a Servicefor more ideas.

    4. Keep it simple! Simplicity allows you to rearchitect more quickly so you can respond to problems. It’s true that nobody really knows what simplicity is, but if you aren’t afraid to make changes then that’s a good sign simplicity is happening.

    5. Shard. Sharding helps to isolate and constrain storage, CPU, memory, and IO. It’s not just about getting more writes performance.

    6. Constant iteration on bottlenecks:
      - Software: DB, caching
      - OS: disk I/O
      - Hardware: memory, RAID

    7. You succeed as a team. Have a good cross discipline team that understands the whole system and what’s underneath the system. People who can set up printers, machines, install networks, and so on. With a good team all things are possible.

    Monday, 13 December 2010

    Well,

    Dear sirs and ladies , seems we haven't found a good hoster yet and we still have to edit some of our blog categories and spots but things are going well since we have returned some of our data and that's pretty encouraging. We hope you are still with us because we need very much support right now. Please comment on this post if you are still with us. Manager

    Thursday, 25 November 2010

    New page added!

    Advertisment page allows you to post your advertisment material without any useless spam around the other categories like it happened/ still happens sometimes . So if you please you can add your advertisment material there .

    Note! Any advertisment outside that page will be moved to trash. Thank you for understanding. Have a good day!

    Tuesday, 23 November 2010

    How Facebook Decides What To Put In Your News Feed

    How does the social media giant decide who and what to put in your feed? Tom Weber conducts a one-month experiment to break the algorithm, discovering 10 of Facebook's biggest secrets.

    The more digital our daily lives become, the more perplexing the questions seem. Will the growth of social media destroy our notions of privacy? Is democracy helped or harmed by the cacophony of opinions online? And perhaps most confounding: Why does that guy I barely know from the 10th grade keep showing up in my Facebook feed?

    If you've ever spent time on Facebook, you've probably pondered that last one. The social-networking giant promises to keep us connected with our friends in exchange for pumping a steady diet of advertising at us—but the algorithms Facebook uses to decide what news to pass along can seem capricious or altogether impenetrable.

    Facebook, much like Google with its search algorithms, consistently refuses to go into details about how it picks and pans content (save a few glancing details this year about the enigmatic engine that powers it, EdgeRank. So, with the mystery of that 10th-grade friend in mind, The Daily Beast set out to crack the code of Facebook's personalized news feed. Why do some friends seem to pop up constantly, while others are seldom seen? How much do the clicks of other friends in your network affect what you're shown? Does Facebook reward some activities with undue exposure? And can you "stalk" your way into a friend's news feed by obsessively viewing their page and photos?

    To get the answers, we devised an experiment, creating our own virtual test lab within the confines of Facebook and tracking thousands of news-feed items over a period of several weeks. The focal point of our experiment: Phil Simonetti, a 60-year-old Facebook newcomer who allowed us to dictate and monitor his every move.

    Like a half-billion people before him, Simonetti joined Facebook and began typing in his status updates. But in this case, Simonetti's only friends were a hand-picked roster of more than two dozen volunteers who agreed to sift through their news feeds for the duration of our experiment, dutifully recording any Phil sightings.

    As our volunteers checked in with their reports, some remarkable findings began to emerge:

    1. Facebook's Bias Against Newcomers. If there's one thing our experiment made all too clear, it's that following 500 million people into a party means that a lot of the beer and pretzels are already long gone. Poor Phil spent his first week shouting his updates, posted several times a day, yet most of his ready-made "friends" never noticed a peep on their news feeds. His invisibility was especially acute among those with lengthy, well-established lists of friends. Phil's perpetual conversation with the ether only stopped when we instructed our volunteers to interact with him. A dynamic which leads to…

    2. Facebook's Catch-22: To get exposure on Facebook, you need friends to interact with your updates in certain ways (more on that below). But you aren't likely to have friends interacting with your updates if you don't have exposure in the first place. (Memo to Facebook newcomers: Try to get a few friends to click like crazy on your items).

    3. The Velvet Rope: "Top News": The real fun began when we eventually instructed different subgroups of our volunteer-friend force to interact with Phil in a controlled manner.

    Suddenly, Phil began popping up on feeds. But which ones? The current newsfeed system offers users two options: "Top News," a highly selective feed of updates from friends, and "Most Recent," a "fire hose" that shows updates in reverse chronological order.

    A bunch of interactions, however, still do not guarantee that you'll get on anyone's Top News, which is how a vast majority of Facebook users get their information. Some of our volunteers reported frequent sightings of Phil's updates in their Top News feeds, while others saw him rarely—and in some cases, never. Top News will show you hours-old updates from some friends while ignoring newer postings from others.

    Facebook has a reason to do this: If users saw all of the posts for all of their friends, they might be overwhelmed (or bored) and tune out—a disaster for Facebook, which needs eyeballs to earn revenue. But in doing so, Facebook's ranking system makes judgments about items it thinks you'll be interested in.

    What became clear after two weeks was that it's not the amount of activity you have, but the type (more on that below).

    4. "Most Recent" News Is Censored, Too. As veteran Facebook users know, it's a simple matter to switch from the filtered-and-prioritized Top News feed to the "fire hose" of Most Recent. In Most Recent, items are displayed in reverse chronological order. So many users naturally assume that Most Recent contains every update from all of their friends.

    Not so, as our experiment showed.

    Even with test-subject Simonetti posting updates, links, photos, and videos several times a day, a few of our volunteers found that the items didn't appear in their Most Recent feeds. (At least, not until we took additional steps to up Phil's visibility.) If you've never tinkered with the "Edit Options" button on your Most Recent feed, this underscores why you should check it out—there's a little-used setting that caps the number of friends shown in the feed.

    5. "Stalking" Your Friends Won't Get You Noticed. Maybe you've fretted about it while poring over photos of an old flame or estranged friend on Facebook—or maybe you've diligently worked to get on someone's radar by clicking all over their page. Do Facebook's mysterious algorithms factor your stealthy interest in another person into that person's news feed?

    To find out, our test subject spent several days obsessively checking out the posts and photos of some volunteers who had yet to spy him in their feeds. The result was clear: The stalking accomplished precisely nothing.

    6. Having Friends Who Stalk You WILL Help Your Popularity. Stalking does work in the other direction, we found. After Phil spent days posting updates in vain, with most of our volunteers seeing none of them, we tasked a handful of friends to start showing more interest in Phil. Even though he wasn't showing up in their feeds, they sought out his Facebook page repeatedly, clicking on links he had posted and viewing his photos. This was the point at which Phil finally began to break through. It took a few days of constant clicking, but not only did the friends doing the stalking begin to see Phil in their Top News feeds—others who weren't stalking began noticing him as well.

    7. Links Trump Status Updates. We're sure you consider all of your musings fascinating—but Facebook doesn't. At various points in our test, Phil switched between writing plain status updates and posting links to content elsewhere on the Web. Even before some of our friends began stalking Phil, for those who were seeing updates from him, links appeared more frequently than status updates—presumably because links are more effective at driving "user engagement," which translates into people spending more time on Facebook.

    8. Photos and Videos Trump Links. Just as links proved more potent than status updates in making it past Facebook's filter, so did photos and videos Phil posted. Here, too, it is likely a matter of engagement. Think about times you've spotted a thumbnail-size photo from a friend in your feed and clicked to see it full-size. Facebook likes clicks, and photos deliver them.

    9. The Power of Comments. If items you post attract comments from a few friends, it clearly raises your visibility overall. When our selected volunteers began stalking Phil, he finally appeared to many users for whom he had been a no-show. But when we stopped the stalking and moved on to the next phase of our trial, directing a different group of users to not only look in on Phil but also repeatedly add comments to his items, he surfaced on the feeds of still more friends.

    10. Why Facebook Really is Like High School: After weeks of testing and trying everything from having Phil post videos to getting some of his friends to flood him with comments, by the end of our experiment, a few of our volunteers had still literally never seen Phil appear in their feeds, either Top News or Most Recent. These were the "popular kids"—users of Facebook with 600 or more friends. (Conversely, those with only 100 to 200 friends were among the first to spot Phil.) So the key, as you build your coterie of friends, is making sure to include some without huge networks. They'll see more of your feeds, interact in Facebook-approved ways, and up your visibility with all.

    Facebook didn't respond to our requests for comment about our findings. To be sure, this experiment wasn't foolproof. Facebook can—and probably does—draw on variables beyond those in our test. And our volunteer force of friends was only human, and may have missed some of Phil's posts.

    Still, we were able to observe firsthand how Facebook can elevate or bury the news you want to share with your friends. For average users, cracking the Facebook code is something of a fun puzzle. But for marketers trying to tap Facebook—or individuals who see the service as a way to promote themselves—understanding how content propagates through the system is anything but a game.

    But it also means that many users may not be aware of how much power they've put in the hands of this electronic mediator. (The very concept of the news feed was controversial as soon as it was unveiled, as chronicled in David Kirkpatrick's The Facebook Effect.)

    You might think you've shared those adorable new baby photos or the news of your big promotion with all of your friends. Yet not only does Facebook decide who will and won't see the news, it also keeps the details of its interventions relatively discreet.

    All the while, Facebook, like Google, continues to redefine "what's important to you" as "what's important to other people." In that framework, the serendipitous belongs to those who connect directly with their friends in the real world—or at least take the time to skip their news feed and go visit their friends' pages directly once in a while.

    Source

    Hello world!

    Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!