Hey Carl-Wilrijk,
Welcome to Apple Support Communities.
From what you described the files are being uploaded from the iMac to iCloud. Has there been any recent changes such as moving files, editing files, updating software, turning off iCloud and turning back on? Changes may affect the upload process.
As far as the files uploading, the time that it takes to complete will vary because of computer speed and internet speed. If you continue to notice poor performance, boot into safe mode. Safe mode may help determine if the issue is related to software that loads as the Mac boots. For steps on booting info safe mode, click here: Use safe mode on your Mac. We've also included the steps below.
If you're using a Mac with Apple silicon
1. Shut down your Mac.
2. Press and hold the power button on your Mac. As you continue to hold the power button, your Mac turns on and loads startup options. When you see Options, release the power button.
3. Select your startup disk. It's named Macintosh HD, unless you changed its name.
4. Press and hold the Shift key, then click the “Continue in Safe Mode” button below your startup disk.
5. Log in to your Mac. You might be asked to log in again.
If you're using an Intel-based Mac
If you're not using a Mac with Apple silicon, you're using an Intel-based Mac.
1. Turn on or restart your Mac, then immediately press and hold the Shift key as your Mac starts up.
2. Release the key when you see the login window, then log in to your Mac.
3. You might be asked to log in again. On either the first or second login window, you should see ”Safe Boot” in the upper-right corner of the window. If you can't start up in safe mode, make sure that your Mac isn't using a firmware password.
Once you're able to determine if issue happens in safe mode or not, follow the steps in the article. Afterwards, you can restart normally to see if there's any improvement.
If you you're using a Wi-Fi network, and your iMac has the ethernet port, connecting directly to the modem/router may help with upload speed.
Hope this helps. Take care.