Bristol Crown Court heard Christopher Daldorph, 45, spent up to two hours a day over 14 years viewing the material.
Officers from the National Crime Agency (NCA) found 20 devices at his home in West Wick, Weston-super-Mare, when he was arrested in April.
One hard drive alone contained more than 150,000 images and videos.
Daldorph admitted nine counts of making indecent photographs and one count of possessing extreme pornographic images between November 2010 and April this year.
Passing sentence, Judge Geoffrey Mercer QC, said: "For over 14 years, as you admit, you have regularly set time aside to scour the darkest corners of the internet to find some of the more disturbing representations of child abuse available.
"This is in my judgment an extreme case of downloading indecent photographs of children, because of the volume of the material which you downloaded over a substantial time."
Christian Hall of the NCA said: "Daldorph was responsible for amassing hundreds of thousands of indecent images, some of them the most extreme possible involving very young children.
"Each of those involved a child being abused in some of the worst ways imaginable."
Daldorph, who had worked for the NHS for 17 years, was dismissed from his job after he was arrested.

A 59-year-old teacher from London received £185,000 after she slipped a disc in her back after she was knocked to the ground by two unruly pupils.
A member of teaching staff in north Wales was given £100,000 compensation when the chair he sat on collapsed.
The NASUWTteaching union said it had won £16,077,328 for members last year.
A Department for Education spokesperson said:  "School employers are responsible for the health and safety of staff and pupils whether the local authority, governing body or academy trust, and they must adhere to the Health and Safety Act 1974."
Teachers also received smaller payouts over accidents in the workplace, including a £55,000 package for a female member of staff in north-west England who tripped on a tear in the lino surface of her science classroom.
She was later diagnosed with chronic back syndrome.
NASUWT general secretary Chris Keates said many of the injuries would be reduced if employers "took the welfare of staff seriously" and followed good health and safety practices.
She said: "The consequence of negligence is careers, lives and health blighted and millions of pounds of public money spent in compensation.
"Unfortunately, there is no incentive for employers to take health and welfare seriously when they witness the government cutting funding for inspection and failing to take steps to secure compliance with the law.
"Failure to respect the rights of employees and to comply with employment law is also prevalent.
"Employers flout the law, but it's the teachers and the taxpayers who pay the price.
"While compensation is important, it can never make up for the fact that teachers suffer permanent physical and mental injury and often cannot continue in their chosen career."
Separate data from the NUT, which keeps its overall compensation figures private, said there were two cases of personal injury compensation paid to its members last year.
One included a £46,000 payout to a teacher who suffered "severe psychological injury" following "a sustained campaign of bullying and harassment by senior leadership".
Another NUT member was awarded just under £4,500 after she fractured a finger on a defective doorknob, causing her long-term aches and a deformity.
The union said it offered legal help in 130 cases last year, including 71 involving criminal activity and 57 in employment cases.

Michael Robson, 44, who is serving a prison sentence for manslaughter, absconded from Hatfield Prison in Doncaster on Thursday.
Robson, from North Tyneside, was originally convicted of murder in 1996 but had his sentence reduced to manslaughter after an appeal in 2006.
He was arrested by officers in West Yorkshire on Sunday.

The 30-year-old defender has made 200 appearances for the Rams since joining from Coventry City in 2012.
A Republic of Ireland international, Keogh made two appearances at Euro 2016 as Ireland reached the knockout stages.
"He's an important player, on and off the pitch, so it's great news that he has committed his future for the next three years." boss Nigel Pearson said.
A hospital radiographer, who downloaded more than a million indecent images and videos of children, has been jailed for two years and four months.
[NEXT_CONCEPT]
Teachers won millions of pounds in compensation last year after suffering discrimination and serious injuries in the line of work, a union said.
[NEXT_CONCEPT]
A convicted killer who was on the run from an open prison in South Yorkshire has been recaptured, police said.
[NEXT_CONCEPT]
Derby County captain Richard Keogh has signed a new three-year deal, keeping him with the club until summer 2019.