I am using a web-based server (Hostgator). When I run scripts and queries using CPanel, does speed/performance purely depend on the remote server I use or is it also affected by the speed of my local computer?
it purely depends on server performance, once query is fired and it reaches server. performance is also affected by your internet speed but that is too low impact.
it also depends on the query cost, which is affected by your database design/data hence you should consider all these factors if you see the performance hit.
Server performance is the key factor since all the commands you typing are executed on the server.
You can see server resources from server performance link in the cPanel.
Related
How can I see how much data was transferred out of and into sql server during a given time period?
I have an app that makes several SQL queries and updates during a run. How can I see how much data was transferred into SQL Server and out of SQL Server during the time that this app was running?
There are a number of ways you could achieve this (depending on your setup).
You could use a tool similar to Wireshark to monitor the traffic on the SQL Server port. This would monitor, and even log, traffic in/out on that port.
Set up a Trace within SQL Server. The Microsoft documentation site has a lot of material on setting up Traces. This is used by the SQL Profiler tool.
If you are with a host like AWS, you can report on that directly within the AWS console. Whoever you are hosting with, if there isn't an obvious option to monitor this, you could still reach out to them and see if they have anything available. [This answer is only valid if you're using a host and not running a server from your house/office]
I have a database on Azure that is around 500mb, ~50 tables and a few tables with 100k+ records. A single table with ~1000k records. This is not a big database (around 20-50 DTU's). I have an ASP.NET MVC application that runs on top of this database.
When I run towards this database either from local or on my test/production environment, the database is extremely fast. My code is "solid production code" (indexes, paging), meaning I do not do anything crazy and this works on pretty heavy production loads.
However, when I import this database locally, it's VERY, VERY slow (pages takes 10-20 seconds to load, or simply fails). This results in I basically cannot run my application locally. Here is an example error I get (DK error message, but the typical error - see The wait operation timed out. ASP ) :
I experience the same problem when I run queries outside my main application. I am 99% sure this is a database problem, not an application problem because when I run scripts it's very slow too.
Any idea what the problem is? Why is my localhost so slow it cannot barely run normal queries?
This is how I created my local databae:
Save to local desktop:
I import into (localdb)\MSSQLLocalDB :
Wait for this to happen and everything is confirmed. I then change my connection string to this database.
I suspect you do not have enough RAM to host your own server. I had that problem, locally hosting MSSQL server 2012 with 8GB of RAM on a Windows 10 machine, with Core i7 10th Gen. Sometimes there were no problems, but mostly I was getting very slow query response times, and even timeouts. This was my development machine, and I noticed that all the RAM was being consumed, just from development alone, without any database connections. So I suspected that there was not enough memory for querying the database as well.
I increased the RAM to 32GB (but 16GB would have sufficed), and problems solved.
Enabling TCP/IP connections to your local server could resolve this issue.
Start -> Run -> mmc
File -> Add/Remove Snap-in...
SQL Server Configuration Manager -> [OK]
SQL Server Network Configuration -> Protocols for MSSQLSERVER -> TCP/IP=Enabled
Restart server.
consider I write a desktop software in C# for example,and it reads/writes data to/from sql server,Can I run this software on a system without having sql server installed.
I saw the two links of stackoverflow,but did not get my answer.
I want to know CAN THAT BE DONE OR NOT?
if yes,how?
thanks in advance.
Sql Server must be installed, and running, somewhere to be able to use it. However, this does not need to be on local machine. The most common scenario for Sql Server is to be installed on a dedicated server machine off in a data center somewhere, and either many clients will connect to and use the same database, or one or a few web servers will connect potentially many times per second with different requests. It's not really intended for desktop use.
If you want to build a desktop app, and you want a database to use only as a local data store, Sql Server is actually a really poor choice for this. That includes the free Sql Server Express. Don't use it for applications that will be distributed to end users, where all the data will kept on each user's local system. It is a server-class engine, and works best when it can run on dedicated hardware.
Instead, you want a desktop-class or in-process database engine, such as Sqlite, Sql Server Compact (not Express) Edition, or even MS Access.
There are many SQL engines that can be embedded in desktop application. For example SQLite, there should be one with C# interoperability.
I am working on an application in my free time and I want to use a SQL Server database. I have the .iso for SQL Server 2008 R2 Developer but I don't have an extra computer to dedicate as a server. I assumed I could use VMware Player for a virtual server but from what I've read it seems that I would need VMware vCenter or another paid version.
Is there a free option for creating a SQL Server database virtually? This will be extremely small scale (3 tables and just for my personal use) so I am not worried about performance at all.
You can install that locally on your computer. There is no need for a virtual engine. Even if some of the MS documents say you need a server operating system, that is not the case. The setup has a check for valid operating system, and it just installs fine on Windows XP, Vista, 7 in my experience.
But if you want, VMWare Player would also work. In contrast to its name, you can also create virtual engines with it - but with some limitations.
And for a really small solution, even SQL Server Express, which is also free, would do. If I remeber correctly, the main restriction is that the data may not exceed 1 TB.
SQL Server can run locally without any problems, even in your dev/gaming/browsing computer without creating too much interference. There is no problem in installing it for testing and even for production of small systems (the express edition is free and valid for those uses).
Another, even slimmer, alternative, if you dare to upgrade to SQL 2012, would be to use a new feature called LocalDB. It's basically the very same db engine with a very important difference: it does NOT run as a service, but instead it's a regular program that is automatically started when a connection is attempted. Advantages would be that it does not consume resources until it's needed and yet you've got almost the full feature set of the real server. Here is an introduction on it. While I've never used it (always with the full express version), it seems good for the kind of programs you want to develop.
I have been working on the software using a SQL Server database. Now I am in the phase when I would like to provide this software for other people, but I don't know how to manage the database. The thing is that it is really inconvenient when installing my software to also install SQL Server at the users computer (many unexpected thing could happen).
Therefore I thought that I would pay for web hosting with SQL Server, but it is:
Expensive (just for database with few tables).
Most of the web hosting don't offer remote access to the SQL Server database (so I can't connect there from my software).
So there is my question, what would you do? My own virtual server? (even more expensive), or would you install SQL Server on users computer? Or do you know where to get only SQL Server hosting for low costs?
I don't advice using a remote SQL Server. SQL Connections strongly depend on network connection and the Internet is not "stable" enough for that. There are also performance issues that will make your application completely useless.
One important thing you didn't mention is whether different users will share the same data or will have their own. If each user will use their own data you can install a "local" SQL Server Edition (SQL Compact Edition, here is the reference)
http://msdn.microsoft.com/en-us/library/aa983341(v=vs.110).aspx
In case several users will share the same data, you shouldn't rely on the database solely. One possible approach is having an Application server that implements business logic whereas your desktop application stays actiong as a "dumb" client. This is a lot better for performance and reduce data transfer problems. You can implement webservices for you application server. This is a good solution as the data is transfered from he application server to the clients through HTTP/HTTPS and this relieves you from dealing with ports and other communication issues. An alternative is using Microsoft Communication Framework (WCF)
Good luck!