Image copyright Punch magazine Image caption Failing to fund new drains was costing lives, said Punch magazine

Suffering in the hot weather? Spare a thought then for the population of London back in 1858, a year of sky-high temperatures and the Great Stink.

That year, the London Standard reported temperatures of over 30C by the middle of June and the weather stayed hot for several weeks

There was no air conditioning, no refrigeration, it was really hard to keep food fresh and there was no proper sewerage system, according to Museum of London curator Beverley Cook.

Everything you didn't want ended up in the River Thames, from the contents of people's chamber pots and the new-fangled flush lavatories, to dead dogs, decomposing food and industrial waste, including animal parts from abattoirs and chemicals from leather tanning factories along the river.

The Thames embankment had not yet been built, accidental drownings and river suicides were common and bodies were rarely recovered from the water.

On top of this, everything was horse-drawn - so the streets were full of massive piles of manure, says Ms Cook.

"Flies were swarming down on this and of course transmitting disease such as diarrhoea and typhoid."

It was a nauseating mix and the heat made it worse - standing close to the river was enough to make you retch.

It was dubbed the Great Stink and it was no joke.

Image caption Standing this close to the Thames in London in 1858 would have been impossible, says Museum of London curator Beverley Cook.

By the 1850s, London was the largest city on the planet, with a rapidly growing population that had already topped 2.5 million - but it was struggling to provide its citizens with clean water and sanitation.

In Little Dorrit, written that decade, Charles Dickens described the Thames: "Through the heart of the town a deadly sewer ebbed and flowed, in the place of a fine fresh river."

Worse, Londoners drew their drinking water from the Thames and its tributary rivers, which were often just as polluted.

A condition called summer diarrhoea was common, as was typhoid, while cholera killed thousands in a series of epidemics.

"The conditions for Londoners were absolutely appalling," says Ms Cook.

"Obviously the river runs throughout London. It's quite difficult to avoid.

"If you went anywhere near the riverbanks, you would really be hit with this terrible smell that was referred to as a miasma.

"There are many accounts of Londoners saying that they were being sick if they went anywhere near because of the smell and they were trying to cover their faces with masks or cloths."

Image copyright Museum of London

In the newly built House of Commons, MPs found it impossible to use rooms overlooking the river.

The curtains were doused with a product called chloride of lime.

Its manufacturers made extravagant claims for its disease-preventing properties - but really it was little more than air freshener, which had little impact on the appalling pong.

Back then smell, or miasma, was thought to carry disease - so the stink was terrifying.

That some diseases were waterborne was only beginning to be accepted.

Image copyright Punch magazine

Satirical magazines depicted Old Father Thames as a filthy old man and his offspring as deformed and diseased, says Ms Cook.

This was the height of the British Empire - the river traditionally had a reputation "as a river of wealth, huge wealth coming into London from the growing empire but it was also becoming a river of death", she says.

"The crisis had been building for a few years and I think really the heat of that summer was a tipping point.

"The fact that Parliament was sitting during that hot summer was really the impetus for something to be done."

Image copyright PoppyPixels Image caption There was no escape from the stink in the Houses of Parliament

It fell to the then Chancellor of the Exchequer, Benjamin Disraeli, to propose a bill, which MPs debated and passed within 18 days.

At its first reading on 15 July, Disraeli told MPs: "That noble river, so long the pride and joy of Englishmen, which has hitherto been associated with the noblest feats of our commerce and the most beautiful passages of our poetry, has really become a Stygian pool, reeking with ineffable and intolerable horrors.

"The public health is at stake; almost all living things that existed in the waters of the Thames have disappeared or been destroyed; a very natural fear has arisen that living beings upon its banks may share the same fate; there is a pervading apprehension of pestilence in this great city."

It became law on 2 August 1858, giving the Metropolitan Board of Works the authority and cash to embark on the biggest civil engineering project of the century the following year, with Joseph Bazalgette in charge.

Bazalgette's design was for a system of interconnecting sewers, to capture London's waste before it could reach the Thames, and new embankments with sewers inside them.

Image copyright Crossness Engines Peter Scrimshaw Image caption The Beam Engine House at Crossness Pumping Station

The sewage was piped out to elaborately designed pumping stations, including Crossness and Abbey Mills.

It still went into the river but in less populated areas - "out of sight out of mind", according to Greg Warner, a volunteer with the Crossness Engines Trust, a charity devoted to restoring the Victorian engines.

They fell out of use, during the 20th Century when it became unacceptable to pump raw sewage into the environment.

For Mr Warner, Sir Joseph Bazalgette is "a bit of a hero" responsible for "a vast improvement in the public health of London".

"Imagine sewage 18in [45cm] thick on top of the Thames.

"Physically, he got all the sewage out of central London."

Media playback is unsupported on your device Media caption Prof Simon Schaffer of BBC Four's Mechanical Monsters takes a close look at one of Bazalgette's giant steam pumps.

Thames Water says the pipes are "still in perfect working order" although designed for a much smaller city.

Major works are under way to gear the system for a population predicted to reach 10 million by 2030.

Bazalgette's design was executed "to the highest standards, to the highest specification", says Ms Cook.

"This was a very well planned, very well executed project.

"That was the benefit of the wealth of London because there was no issue with money - just do it and do it to the best."

Museum of London is running free Great Stink talks during August and there's an open day at Crossness on 12 August.