My website allows users to upload their photos
Can I put kb/sec
(or similar) limit on uploads to prevent them impacting performance of the frontend of my site?
My website allows users to upload their photos
Can I put kb/sec
(or similar) limit on uploads to prevent them impacting performance of the frontend of my site?
If you experience such strong performance impact, you should split your website onto multiple servers, one that delivers read-only content and the other one that is used when the user interacts by uploading files or doing database updates.
Slowing down the upload (or download) bandwidth will actually make the impact elsewhere worse - not better until you actually get to the point where all your incoming bandwidth is used up.
Before you seize on the caveat I've just given - this is a very unusual scenario for a webserver. Go measure your bandwidth usage in and out first.
If the very remote possibility that your incoming bandwidth is completely hogged by uploading then you really need to stop people from uploading som much - not slow them down so that the process hogs memory, CPU and processes for longer.
It is usually a good idea to limit the connection rate (not bandwidth) per client address to protect against DOS attacks - but this is better done at the perimeter of your network rather than on the server itself.