I'm not sure of where to ask a question about a .Net 4.5.1, ASP.Net, MVC 5, web application that displays a "Can't reach this page" error screen after about 90 minutes during a long update to an SQL 2016 database.
The is generally a network timeout issue which can happen anywhere along connection. When the connection closes the web server returns this error to the browser.
IMHO, a web application should never wait 90 minutes (or even 5 minutes) for a process to end. You are using the wrong technology to solve to solve a problem and most likely should be looking at stand alone exe, SQL agent, or scheduled task.
IMHO, a web application should never wait 90 minutes (or even 5 minutes) for a process to end. You are using the wrong technology to solve to solve a problem and most likely should be looking at stand alone exe, SQL agent, or scheduled task.
What you say about a web application should never wait for a long running process is not consistent with the numerous examples and tutorials explaining how to use SignalR to display the status of long running processes in ASP.NET MVC web applications. If
it should not be done in a web application, then why would they give so many examples of how to accommodate it?
Is there a way to run a standalone.exe program in a web application?
What you say about a web application should never wait for a long running process is not consistent with the numerous examples and tutorials explaining how to use SignalR to display the status of long running processes in ASP.NET MVC web applications. If it
should not be done in a web application, then why would they give so many examples of how to accommodate it?
You are confusing technologies and common design patterns. A long running process should be outside a web application and not dependent on the host. SignalR is a persistent connection with a web server but this connection should not be dependent on the
process but report on the process. Are you using SignalR?
tgirgenti
Is there a way to run a standalone.exe program in a web application?
It is possible but again not a good design practice. You can start the process with a web request but the process itself should run in its own application domain. Not the within the web host. Generally, we use SQL agent or a scheduled task to kick off
a process.
mgebhard is correct. It could very well be that if your server-sider code is performing a number of operations against the database that the application pool has recycled and run out of resources throwing you into that state.
A good example of SignalR usage would be video encoding. You upload a video to a service that needs to encode it for display on the web. The process needs to go off and do stuff because it is handled by something else, such as a windows service that pops
items off a queue for encoding. The website is essentially done all it can do, and waits for notification from another process that it's finished. That's an appropriate use.
The reasons there are so many SignalR examples of doing things, in some cases where it shouldn't be used that way, are people trying to use it to solve their problem because they can't do it correctly, don't have the time or resources to do it correctly,
or just don't understand that they are not really solving the problem correctly.
The first step may be to examine the long running process to determine if it's designed correctly, if it's efficient, if it should be done within the web application at all.
Don't forget to mark useful responses as Answer if they helped you towards a solution.
I probably am confused since I am not as knowledgeable about web applications as you apparently are.
I can't discuss technologies and common design patterns with you since I am not familiar with the difference. All I know is there are dozens of examples of how to display messages to clients screens during long running processes in web applications.
I am not using SignalR, but I am considering it so that I can maybe see where the "Can't reach this page" error screen is occurring. I figured if the screen is constantly displaying update progress messages, it probably won't go into the "Can't reach this
page" error screen.
mgebhard is correct. It could very well be that if your server-sider code is performing a number of operations against the database that the application pool has recycled and run out of resources throwing you into that state.
I don't disagree with mgebhard. My application is writing about 8500 records to an SQL database table. Is there a way to tell the application pool to not recycle while the update is running?
markfitzme
The reasons there are so many SignalR examples of doing things, in some cases where it shouldn't be used that way, are people trying to use it to solve their problem because they can't do it correctly, don't have the time or resources to do it correctly,
or just don't understand that they are not really solving the problem correctly.
This article from Microsoft explains how to use SignalR to do those things. Are they not solving it correctly?
markfitzme
The first step may be to examine the long running process to determine if it's designed correctly, if it's efficient, if it should be done within the web application at all.
What steps can I take to determine if my long running process is designed correctly or if it's efficient?
I can't discuss technologies and common design patterns with you since I am not familiar with the difference. All I know is there are dozens of examples of how to display messages to clients screens during long running processes in web applications.
Monitoring a long running process and hosting a long running process are two different things.
Monitoring a long running process and hosting a long running process are two different things.
So, SignalR Monitors a long running process?
Thanks,
Tony
I'm not sure how you are making this correlation.
SignalR is a web socket technology for sending and receiving messages over a persisted connection between a browser and web server. SignalR is
a great choice for monitoring a long running process. However, SignalR can be used for other purposes like a chat application or notifying clients when something changes like your favorite team scores.
Sorry, I should have clarified that it's often used in the monitoring step of a long running process where it can be used to notify a user when something has happened, such as 'your file has been processed'. It's bad when it's built into the long running
process as a message-pump, because that means the long-running process is designed to run for long durations within the application itself. There are often other means for handling the process that can separate it out from the website. SignalR is often used
in a monitor step to provide notification to subscribed clients that something has happened.
Another example of SignalR that may help clarify is, say you have a customer record application. User A accesses the record and needs to modify something. User B also access the record. SignalR could be used to notify anyone who is subscribed to that customer
channel that someone else is accessing the record.
Don't forget to mark useful responses as Answer if they helped you towards a solution.
If going past few minutes, it's likely best to offload this job to a batch processing mechanism rather than to expect a user would wait for this page until completion or would keep looking which processing step is reached. It would be likely best to offload
this to some batch processing mechanism.
Also have you tried to check if this is expected. More than 90 minutes for processing 8500 rows seems really slow IMHO.
If you want to learn something about how to display real time sql server database change notification in ASP.NET using SignalR and SqlDependency object which represents a query notification dependency between an application and an instance of SQL Server.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
For example you could just write this request to a database table and a SQL job or scheduled console app would check this table every few minutes to do the corresponding processing and write something when completed.
The site would just show some kind of notification once the job is marked as done (even if the user just log the next day).
90 minutes for 8500 rows seems slow. Make sure maybe as a start that you don't have something that could be improved here (missing indexe, unwanted joins etc...)
Member
34 Points
345 Posts
Not sure of where to ask a question about...
Oct 21, 2017 06:03 PM|TGirgenti|LINK
Hello,
I'm not sure of where to ask a question about a .Net 4.5.1, ASP.Net, MVC 5, web application that displays a "Can't reach this page" error screen after about 90 minutes during a long update to an SQL 2016 database.
Thanks,
Tony
All-Star
52091 Points
23211 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 01:23 PM|mgebhard|LINK
The is generally a network timeout issue which can happen anywhere along connection. When the connection closes the web server returns this error to the browser.
IMHO, a web application should never wait 90 minutes (or even 5 minutes) for a process to end. You are using the wrong technology to solve to solve a problem and most likely should be looking at stand alone exe, SQL agent, or scheduled task.
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 02:03 PM|TGirgenti|LINK
Hello mgebhard.
Thanks for your help.
What you say about a web application should never wait for a long running process is not consistent with the numerous examples and tutorials explaining how to use SignalR to display the status of long running processes in ASP.NET MVC web applications. If it should not be done in a web application, then why would they give so many examples of how to accommodate it?
Is there a way to run a standalone.exe program in a web application?
Thanks,
Tony
All-Star
52091 Points
23211 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 02:36 PM|mgebhard|LINK
You are confusing technologies and common design patterns. A long running process should be outside a web application and not dependent on the host. SignalR is a persistent connection with a web server but this connection should not be dependent on the process but report on the process. Are you using SignalR?
It is possible but again not a good design practice. You can start the process with a web request but the process itself should run in its own application domain. Not the within the web host. Generally, we use SQL agent or a scheduled task to kick off a process.
All-Star
26071 Points
5892 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 03:01 PM|markfitzme|LINK
mgebhard is correct. It could very well be that if your server-sider code is performing a number of operations against the database that the application pool has recycled and run out of resources throwing you into that state.
A good example of SignalR usage would be video encoding. You upload a video to a service that needs to encode it for display on the web. The process needs to go off and do stuff because it is handled by something else, such as a windows service that pops items off a queue for encoding. The website is essentially done all it can do, and waits for notification from another process that it's finished. That's an appropriate use.
The reasons there are so many SignalR examples of doing things, in some cases where it shouldn't be used that way, are people trying to use it to solve their problem because they can't do it correctly, don't have the time or resources to do it correctly, or just don't understand that they are not really solving the problem correctly.
The first step may be to examine the long running process to determine if it's designed correctly, if it's efficient, if it should be done within the web application at all.
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 03:08 PM|TGirgenti|LINK
mgebhard,
I probably am confused since I am not as knowledgeable about web applications as you apparently are.
I can't discuss technologies and common design patterns with you since I am not familiar with the difference. All I know is there are dozens of examples of how to display messages to clients screens during long running processes in web applications.
I am not using SignalR, but I am considering it so that I can maybe see where the "Can't reach this page" error screen is occurring. I figured if the screen is constantly displaying update progress messages, it probably won't go into the "Can't reach this page" error screen.
Thanks,
Tony
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 03:30 PM|TGirgenti|LINK
markfitzme,
Thanks for your help.
I don't disagree with mgebhard. My application is writing about 8500 records to an SQL database table. Is there a way to tell the application pool to not recycle while the update is running?
This article from Microsoft explains how to use SignalR to do those things. Are they not solving it correctly?
What steps can I take to determine if my long running process is designed correctly or if it's efficient?
Thanks,
Tony
All-Star
52091 Points
23211 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 03:52 PM|mgebhard|LINK
Monitoring a long running process and hosting a long running process are two different things.
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 04:10 PM|TGirgenti|LINK
So, SignalR Monitors a long running process?
Thanks,
Tony
All-Star
52091 Points
23211 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 04:43 PM|mgebhard|LINK
I'm not sure how you are making this correlation.
SignalR is a web socket technology for sending and receiving messages over a persisted connection between a browser and web server. SignalR is a great choice for monitoring a long running process. However, SignalR can be used for other purposes like a chat application or notifying clients when something changes like your favorite team scores.
All-Star
26071 Points
5892 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 04:57 PM|markfitzme|LINK
Sorry, I should have clarified that it's often used in the monitoring step of a long running process where it can be used to notify a user when something has happened, such as 'your file has been processed'. It's bad when it's built into the long running process as a message-pump, because that means the long-running process is designed to run for long durations within the application itself. There are often other means for handling the process that can separate it out from the website. SignalR is often used in a monitor step to provide notification to subscribed clients that something has happened.
Another example of SignalR that may help clarify is, say you have a customer record application. User A accesses the record and needs to modify something. User B also access the record. SignalR could be used to notify anyone who is subscribed to that customer channel that someone else is accessing the record.
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 05:26 PM|TGirgenti|LINK
I am simply asking a question.
Thanks,
Tony
All-Star
48260 Points
17978 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 05:45 PM|PatriceSc|LINK
Hi,
If going past few minutes, it's likely best to offload this job to a batch processing mechanism rather than to expect a user would wait for this page until completion or would keep looking which processing step is reached. It would be likely best to offload this to some batch processing mechanism.
Also have you tried to check if this is expected. More than 90 minutes for processing 8500 rows seems really slow IMHO.
Member
34 Points
345 Posts
Re: Not sure of where to ask a question about...
Oct 22, 2017 05:52 PM|TGirgenti|LINK
Patrice,
Thanks for your help.
How would I create a batch processing mechanism to update the database for my website?
Thanks,
Tony
Star
8670 Points
2882 Posts
Re: Not sure of where to ask a question about...
Oct 23, 2017 06:41 AM|Cathy Zou|LINK
Hi tgirgenti,
If you want to know how to display real time updates from the SQL Server by using SignalR and SQL Dependency in ASP.NET MVC,
You could refer to the following article.
http://www.venkatbaggu.com/signalr-database-update-notifications-asp-net-mvc-usiing-sql-dependency/
If you want to learn something about how to display real time sql server database change notification in ASP.NET using SignalR and SqlDependency object which represents a query notification dependency between an application and an instance of SQL Server.
You could the article below:
http://techbrij.com/database-change-notifications-asp-net-signalr-sqldependency
Or need something as following?
https://www.codeproject.com/Tips/1075852/ASP-NET-MVC-SignalR-SqlDependency-and-EntityFramew
https://www.codeproject.com/Articles/889240/Real-Time-Data-Update-Using-SignalR
Best Regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
All-Star
48260 Points
17978 Posts
Re: Not sure of where to ask a question about...
Oct 25, 2017 12:53 PM|PatriceSc|LINK
For example you could just write this request to a database table and a SQL job or scheduled console app would check this table every few minutes to do the corresponding processing and write something when completed.
The site would just show some kind of notification once the job is marked as done (even if the user just log the next day).
90 minutes for 8500 rows seems slow. Make sure maybe as a start that you don't have something that could be improved here (missing indexe, unwanted joins etc...)