While the economy has been in the shitter, I've written possibly the most coolest site EVER for unemployed developers looking to buzzword-ify their resumes. (Don't hate the player, hate the game.)
The only problem is, it needs a scheduled task to run once a day to do some data mining. I spent many, many hours a few months ago researching solutions, but nothing seemed sure-fire.
If I have shared hosting and cannot remote in (e.g. mstsc and create a Schedule Task), how can I create a task that will run once a day on the backend of an ASP.NET website?
After all the research I did, I don't think it's possible. Per my last analysis, someone has to visit the site at least once a day to instantiate an instance of HttpApplication.
Does anyone have any solution to making sure an operation runs automatically, no matter whether anyone visits the site, and without anything but FTP access to the website?
Like I said, I've done A LOT of looking into this in the past, and it didn't seem possible. IF YOU HAVE EXPERIENCE implementing a solution, please, contribute your advice! But not postulating or conjecturing needed--it's far more nuanced and difficult than you're surely imagining.
I had a similar problem. I wrote a cheap utility that issued a web request from my desktop to my web app on a regular schedule.
How To: Send Data Using the WebRequest Class
You could have a look at Quartz.NET for scheduling jobs.
DotNetNuke which is a popular open source .net content management system does this. You can download the source and see exactly how they did it.
I agree with HackedByChinese, but if you don't want to run it from your desktop, you could get something like http://aremysitesup.com/ to ping your site for you.
Can you schedule a task in SQL Server that could call a CLR function? Your hosting provider may not allow either ot both of those, but if they do, then you are golden.
You can use ATrigger scheduling service. A .Net library is also available to create scheduled tasks without overhead.
You can set to call your datamining URL every 1day.
Related example: http://atrigger.com/docs/wiki/17/use-case-delayed-processing
Benefits:
Reporting
Error Log
Tasks List
Great Timing Features
Disclaimer: I was among the ATrigger team. It's a freeware and I have not any commercial purpose.
Related
I recently got into a project where I need to support for two mobile applications build using asp.net.
Can anybody share the jobs need to do in maintaining those projects ?
Thanks.
Nilesh
I think you may consider the following points while you are doing maintenance projects :
1) You should talk to your manager and make them understand that you are overloaded and you can't do effective work if everyone keeps bombarding you with requests which they want fulfilled immediately.
2) You should keep tracking on what you have done and how.
3) Keep backups regular basis of all the tasks you have completed.
4) Keep updating your manager on what task you are working and what you have understand and how you want to work/achieve this.
5) Ideally, all incoming requests should be entered into an issue tracker like JIRA or Mantis. Or at least mailed to the product owner, not you. And he/she should deal with all the complaints from the users too over "why is my request not ready yet?!", allowing you to focus on the development work.
Hope it helps you. :)
I have a web service running and I consume it from my desk application that is written on Compact Framework.
It takes 13 seconds to retrieve 8 results which is kinda slow. I also expect to be retrieving more results in the future. The database query runs fast.
Two questions: how do I detect where the speed slow down occurs? Do I put timers in the Web services code?
I would like to detect whether it is the network or the application code.
This is my first exposure to web services in a real environment so please bear with me.
i used asp.net 2.0 and c# to write a simple web service.
Another good profiler is the EQATEC Profiler. I did a write up on it here: http://elegantcode.com/2009/07/02/eqatec-profiler-and-net-cf-profiling-and-regular-net/
And it works find for .net CF projects. But this will allow you to see if there performance issues in unexpected places.
Your already on the right track of adding event logging, and include timers in them. Note, doing so will add to the over all time it takes, so you'll want to remove them after you track down the culprit. Also look into running the same webservice call multiple-times without re-initiating the connection, that may be cause as well.
-Jay
A starting point is to profile your web service to see where the delay is comming from
Did you know the CLR Profiler? There are some tools you can use to see what is happening
http://msdn.microsoft.com/en-us/library/ms998579.aspx
The database connectivity from your service to the DB could be a possible cause for slowdown. Adding timers should do the trick. If the code isnt too huge, you can look at the coding constructs to come up with an informed decision of where exactly things can be slow. Then add the timers. You would get a fair idea of where things are slowing down.
Two biggest pain points are going to be instantiating the web service reference and transferring all the data over the network. Pending anything turning up where some obvious blunder was made, I would look at ways of reducing the size of your xml and ways of better handling your web service reference.
All I know about the compact framework is that it is a pain to work in. I've worked on a number of web projects though and profiling your server, putting in logging to record the time taken will be helpful. If all the time is being taking post server response, however, it won't do much more than prove your server is working quickly.
SoapUI is a fantastic java application for consuming web services. It has a lot of functionality, including time metrics. I would start with that and see how long it takes to consume the same thing your client would be. Failing issues there, start with what I recommended above.
Several months (maybe even a year or two) ago, I saw an asp .net article that showed how to tell how many people were connected to a running web application. Of course I only glanced over the article & didn't save it. Does anyone remember seeing the article or know where I can find it or perhaps something like it? I have searched Google from the best of my memory of the title & content but I'm getting no hits.
The reason I'm asking is because I have a WCF web service that has crashed several times after I publish updates and the only thing I can think that would cause these weird problems is that people are connected to it & its corrupting the files. I'm not going to publish any more updates during the day now, but we also have a couple of people that work during the night and it would be nice to see if people are connected or not before "flipping the switch".
Any help would be greatly appreciated...
Thanks,
Wali
The following article shows how you can use Session_Start and Session_End of the Global Application Class to count the number of active sessions:
How to show number of online users / visitors for ASP.NET website?
In your search, consider using keywords like
perfmon asp.net sessions
Intel has a good article. Unfortunately, it's 404 at the moment, but Google cache has a nice copy. Original link to the Intel "Using perfmon to tune n-tier .NET applications"
When your WCF service crashes, there are likely to be entries in the Windows event log. If not, then the service should be doing logging on its own. I suggest you look and find out whether the service may not have been telling you wnat's wrong.
We want to try fast track developing a booking/scheduling system for a doctor's room.
The faster to market the better!
End of the day, a scheduling product is dirt standard, and i reckon that there must be a ton of good components out there. It just takes time to go through and evaluate.
Ideally we want to do this in asp.net - the system needs to be web based.
Can anyone reccomend something that they have already played with?
Doesn't have to be a freeby. The speedier the dev the better >:)
Thanks
Using Application Framework from DevXpress http://www.devexpress.com/Products/NET/Application_Framework/ you can build a simple scheduler with Outlook like interface in a few hours.
Of course, if you are using .NET platform
Have you thought about integrating it with Exchange. It has all that you are looking for probably.
I highly recommend Quartz.Net, you can write a simple service very easily to handle all you scheduling needs.
Check out DotNetNuke, they have a lot of addins/extensions that would probably accomplish what you are looking for, and it is open source.
Jeff has previously blogged about using the cache to perform "out of band" processing on his websites, however I was wondering what other techniques people are using to process these sorts of tasks?
Years ago, I saw Rob Howard describe a way to use an HttpModule to process tasks in the background. It doesn't seem as slick as using the Cache, but it might be better for certain circumstances.
This blog post has the details, and there are many others that capture the same information if you look around.
Windows Service
You may want to look at how DotNetNuke does it. I know it is written in VB.NET, but I retrofitted the code into C#. I was perusing the source and noticed they had a feature in their admin area to setup scheduled tasks. These tasks get setup thru the admin interface and stored in the database. When the site starts, thru the Global.asax file, they either created another thread to run this service that then runs the scheduled tasks at their scheduled time. I can't remember the exact logic, it's been a while, but it is definitely a good resource on how other people have done out of band processes for Asp.Net applications. This technique still keeps the logic within the Asp.Net application, but it runs out of band in my opinion.
if it's primarily data processing tasks and you're using MSSQL, how about scheduled SSIS tasks?
Scheduled tasks using http://www.codeproject.com/KB/cs/tsnewlib.aspx or schtasks.exe.
Quartz.NET
MSMQ
SQL Server jobs
Windows service
System.Threading.Timer or System.Timers.Timer
System.ComponentModel.BackgroundWorker
Asynchronous calls and callbacks
Scheduled tasks, or cron jobs.
The problem with scheduled tasks or cron jobs is that they don't share memory space with the web server. You could set up a scheduled task that requested pages from the web server, but that might create problems with long running tasks. It would be nice to have some low priority threads running on the actual ASP.Net application stack to do simple utility tasks like cleaning up caches, monitoring resources, and just to deal with general housekeeping.
Simple queue files along with a separate agent. For each type of out of band process write a separate agent .exe which watches a directory for queue files that include whatever data is needed to perform the specified process.
This may seem dirty but in the real world I find it gives a lot of flexibility, you aren't doing a lot of processing in ASP.net process space and you could easily adapt this style to farm processing out to cheap Linux servers running the agent process on Mono for when you start needing more RAM/CPU/disk.
If you are most comfortable with asp.net pages you can write a small app to handle your job and then "ping" the app with an outside service that monitors your web site. This will keep the app alive.