How to Speed up execution time of DB - asp.net-mvc

I have developed an application in ASP.Net MVC 4.5 framework which is hosted on Application server. I am using two DB Server, One is for Development and another one is for production.
Whenever I have linked my application to Production DB Server, it uploads file very slowly, and when I have linked my application to Development DB Server it uploads file quickly.
Note : Application is hosted on different server.
So, Please guys suggest me, what I have to do.

You either have a network problem or the production server is slow.
Since your local machine's web application can reach the database I guess the database I guess you can upload files too. Try to copy a similar file through Windows Explorer and decide if it is fast or not. If it is slow, you know more.
Get hold of an ops s/he can help you with sniffing the network because being two at a problem is nicer and ofter smarter than sitting in your own chamber.
If the network is fast. Use the same ops to find out the load on the database, if it is using to much cpu/memory.

Related

Database server and application server speed issue

I have a web application developed in ROR and used MongoDB as a database.
When the application and database are on the same server, the application loads faster and also the queries execute faster.
But when I move them on separate servers(separate database and application server), the application works as expected but the queries to database server take more than 5-7 minutes to give a response. I also tried to put those servers in the same region, but that doesn't improve anything.
These are some possible scenarios,
Check if both the server are in same region eg. Asia Pacific(checked)
Check if do we need to do some extra OS level configs for MongoDB to increase the size of virtual memory
Check if mongoid.yml has some options to improve access
Check for MongoDB documentation for other hints
Has anyone faced similar problem? If yes then how did you resolved it?

How to Debug the asp.net web application without disturbing the release build?

I'm working asp.net web based application, I have deployed this application on server, Its getting response on port 80 from a outside client.
I want the to fix the bugs so I want to run this application in Debug mode so that I can attach the worker process with the application and this is making the Performance down and its disturbing the QA team.
So can I have two application one can run in release mode so that QA activity does not get disturbed and parallelly I can debug the build and fix the bugs or can do further development.
I'm facing the same problem during the development activity, If multiple developers are working paralley , only one is able to debug the application other one has to wait.
So please suggest me, If I can get rid of this situation.
I have only one server on which I can test this application.
This is a way too long discussion, but I will try to offer you a few ideas:
Each developer should develop on his own machine (sources and database should be local).
In order to sync your work you should use:
a. a source control solution like TFS or SVN (this is free) for your sources.
b. database changes can easily be synced by generating update scripts using SQL Schema Compare directly from Visual Studio (you will need SQL Server Data Tools for this), Redgate SQL Compare or another application that can compare the database strucure (there are many available online, some of them free).
You should have a separate server (DB and app) to testing.
You should have a separate server (DB anb app) for production.
You say you have one server to test the application. But I suppose each developer has his own computer, right? In this case you need to skip #3 and use the same server for testing and production, but with different databases and applications.
I suggest you check this website for similar answers (see Best practice for test and production environments for example) to find the best solution that applies in your case.

Ruby/RoR development: locally or server

Our company has started development of own systems "in-house". We already got couple of developers, who will be responsible for writing code in Ruby/RoR.
We are currently discussing about infrastructure and I would like to ask: should we develop everything on local machines, then put it to test server and later to production, or develop everything on development/test server, then publish it for testing and later to production?
Just an update to the description above: under "local machines" I meant developers' desktops and this test/development server is a machine in our office.
It's a valid question, and as such there's a trade-off to consider.
Generally; work locally. Web app development has a natural flow that leads developers to be saving and refreshing browsers many times an hour. All the time you save on network latency will actually add up, and be less frustrating for the developers.
There are downsides to working locally however, you'll need to make sure that your set-up is EXACTLY as it will be on the testing/production servers. That means everything down to your kernel version, apache version, ruby/rails version. DNS is easy, but again must mimic the live situation perfectly in order for AJAX calls etc to work seamlessly.
Even if you ensure all of the above, you will likely have to make a few minor changes when you move the app to a live server, there just always seems to be something in my experience.
Also, running on a live server isn't SO painful for a developer. Saving a source file from a text editor/IDE via FTP should take less than a second even over the internet, and refreshing a remote browser session will give your UI designers a better feel for the real user experience and flow. If you use SVN rather than FTP much the same applies.
Security isn't much of a concern, lock down FTP and SSH to the office IP, but have a backdoor available if a developer needs to edit a source from somewhere else, so they can temporarily open the firewall to their own IP.
I have developed PHP and Rails apps on a remote test server, on an in-office server and on a local machine. After many years doing each, I can say that as a developer, I don't mind any so much.
As a developer, my suggestion is that you need to 1st do all developing work on your local server. After testing, you need to send to client to make it live.
I'm working as a web developer on Ruby on Rails # andolasoft.com, we are following the same procedure. Hope you got the idea.
Thanks

ASP.NET MVC site takes too much time to load probably because of a Windows service running on the same server

I have a dedicated Windows 2008 server with several websites and 1 windows service running.
The service runs every 30 seconds and is pretty CPU intensive. However all sites are loaded really fast except for the one that is closely connected with the service. This website project dll is referenced from the service, and I think this is the reason it is so slow.
Has anyone had any experience with this? How can I improve the loading time of the site?
Update
Here's more information:
Only the first time load is slow. Subsequent loads are fast. The website and the service access the same MongoDB database. The service also references the website's dll and uses a lot of classes including UsersRepository.
Stopping the service makes the application run normal.
Yes, it was the service's fault. I solved the problem by making a clone of the bin folder which is used for the service only.

Rescue rails app from server failure

I have a rails app which is now hosted on dedicated server. Today something happened: app doesn't respond and I have no ssh access, restarting doesn't help and I am waiting for tech support to respond. But this is not a question, I just need this app to be online even if server fails. Which is the easiest option? Can I create second server on different hosting and serve from there in case of failure, if so, how to sync db and files? Application is not heavily loaded, I just need it to be available.
Difficult problem to solve. There's no one proven way to make this happen, but in general you need "No Single Point of Failure"
There's an entire science devoted to reliability in web applications -- no way can you get that answered in a SO question.
You can take frequent backups of your database, store them on S3 (and/or somewhere else). You can then
have an image of your applications server at your host
spin it up when your server dies
restore the database
Have the new application server take over responsibility (easiest way: assume the old server's IP address)

Resources