Who, what, why: Why was Psy nearly too much for YouTube?
- Published
Psy's Gangnam Style video has been watched so many times that YouTube's counter could not cope and the company had to upgrade its system. Why did this happen?
The catchy Korean pop video catapulted the artist Psy and his signature dance moves to fame in 2012 and two years later, Gangnam Style is still the video most watched on YouTube.
At the time of writing, it has had 2,155,653,764 views - which is actually a bit of a problem, as YouTube's view counter could not count beyond 2,147,483,647.
"We never thought a video would be watched in numbers greater than a 32-bit integer (=2,147,483,647 views) but that was before we met Psy," says YouTube in a statement.
The phrase "32-bit integer" is significant because it refers to how big a number a computer's memory can store.
Computers work in binary code - a system of zeros and ones. Every number we use has to be turned into a series of binary digits or "bits" so that a computer can understand it.
It can help to think of 32 bits as a row of 32 boxes. The boxes can have either a one or a zero in them and every box corresponds to a different number, each of which is double the number for the previous box.
For example, the first box corresponds to the number one, the second to the number two, the third to the number four, the fourth to the number eight and so on.
The computer adds up boxes with ones and ignores those with zeroes. The longer the row of boxes, the bigger the number the computer can record.
Most computers use 32 binary digits because this is easy to process and covers most common numbers.
"It's the same as though you had four spaces to write down your number in and you need a fifth space to put the next one in," says Steven Bagley, a computer scientist from the University of Nottingham.
"It is the same as far as a computer is concerned. It needed that extra bit to store that number."
YouTube had not thought it was possible for a video to get more hits than could be stored in a 32-bit number. But the Gangnam Style video crept closer and closer to the limit.
If it had crossed it then, like an odometer clocking the miles on a car, the counter would simply have gone back to the beginning.
This would not necessarily have even been zero as some 32-bit integers are used to count negative numbers. The next number it showed could have been several million below zero.
YouTube averted this by upgrading to a 64-bit integer and because computers are programmed to count up by the power of two, the new limit is 9,223,372,036,854,775,808, or more than nine quintillion.
They don't think even Gangnam style could break that one.
Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.