Arcgis online is paid service, it is fast, you pay ESRI credit from your anual contract with ESRI. You have no freedom, you can't upload Map Service, you can only upload Feature Service. Tile service is limited.
Use your own arcgis portal, your own arcgis server. You are free of charge. You are free to to upload whatever you like. You are free to configure what ever you like. You are lift from any limitation that Arcgis online placed on you. But it will be very slow, if you don't have money to rent a top level Amazon EC2 server.
Your arcgis server is very slow First thing you should check is max return count
ESRI recommended max return count is 1000 or 2000, actually means:
If you are going to upload your web service to Arcgis online ( hosted on arcgis.com domain ) using your ESRI credit to pay for the service. You can set max return count to 2000.
If you are going to upload your web service to your own domain, your own arcgis portal, your own arcgis server, then ESRI recommendation is no longer hold for true.
You don't pay ESRI credit to use your own arcgis portal, your own arcgis server. However, most of case, your own arcgis server is way too slow compare to ESRI's server. ( ESRI rent Amazon's Top level EC2, have top level band width, top level CPU count, top level capacity of RAM, ESRI has special team to monitor Server Performance, tuning any issue that can slow down their server. ) Your own arcgis server don't have any of these resource that ESRI had.
If your arcgis server is slow, then you should reduce this number to below 1000. Between 50 to 500 is good number if your web server have less than 8 core CPU, 64GB RAM, 4GB band width.
Let's look the real world example !
This is Palm Springs' s own server, own arcgis portal, have 4 Core CPU, 16 GB RAM, 4 GB band width, very slow, almost useless.
https://transparentgov.net/json2tree/esri/server/folder.html?org=https%3A%2F%2Fgisnexus.palmspringsca.gov%2Fserver%2Frest%2Fservices&url=https%3A%2F%2Fgisnexus.palmspringsca.gov%2Fserver%2Frest%2Fservices
This is Palm Springs's Arcgis online, using ESRI's arcgis server, paid ESRI credit for every layer, very fast, but down side is you can't upload Map service, you can only upload Feature Service. Tile service is limited. You don't have a lots of freedom as you use your own arcgis server.
https://transparentgov.net/json2tree/esri/server/folder.html?org=https%3A%2F%2Fservices.arcgis.com%2Ff48yV21HSEYeCYMI%2Farcgis%2Frest%2Fservices&url=https%3A%2F%2Fservices.arcgis.com%2Ff48yV21HSEYeCYMI%2Farcgis%2Frest%2Fservices&select_folder=1&select_layer=0
ESRI recommendation is based on if you are using ESRI's server by uploading your web service to Arcgis Online.
https://enterprise.arcgis.com/en/portal/10.7/use/server-configuration-details.htm#:~:text=Max%20record%20count%20should%20be,returned%20in%20a%20single%20request.