banco-alimentar / alimentestaideia.pt

Site doações alimente esta ideia
http://alimentestaideia.pt
Other
10 stars 0 forks source link

Site too slow #693

Closed tiagonmas closed 1 year ago

tiagonmas commented 1 year ago

Describe the bug Pages are taking too long to load image

guerrerotook commented 1 year ago

Yes you are right saying that the site too slow, especially on the statis files. I have been improving this over time but I did make a new change to even increase this more.

Before we have a lock statement when trying to create a BlobContainerClient to get the static file from Azure Storage. That cause that when the browser calls the server for those small, gif or js, files a lot of requests at the same time has to wait for this.

Now what I am doing is creating this BlobContainerClient in the middleware for the tenant, so in the rest of the execution of the request the BlobContainerClient will be always available and there is nothing to lock the thread.

tiagonmas commented 1 year ago

Moved dev to production but still things are running slow. eg DonationHistory image

tiagonmas commented 1 year ago

Eg loading subscriptions details image

tiagonmas commented 1 year ago

is sql a problem ? image

tiagonmas commented 1 year ago

Many pages are taking too long in DataTAbleData and this one is saying there are duplicate calls image

guerrerotook commented 1 year ago

Over all the performance of the web site is ok. SQL is not a problem because right now we are running in the basic mode for SQL and the performance is ok.

About the duplicate SQL calls, you where in the details for the subscriptions and we were making similar calls to the database, nothing to worry about.

The main driver for the bad performance was the StaticFileProvider where files for the tenant where backed up in a Azure Storage Account and that was making the server to all threads to wait because all threads where making HTTP request to Azure Storage Blob, I made a optimization by enabling a cache in the hard drive of the VM where the website is running and now the performance should be ok.

tiagonmas commented 1 year ago

This is the AVG of last 24h in production. If you put 95% numbers go up to minute :( image