Is SQL query execution a part of TTFB? - database-connection

I am facing an issue with a load time of a web page where the page loads in around 1.5 min and TTFB is close to 1.2 min.
What I see is that the database table has 17k rows which can be a reason of this slowness.
But TTFB refers to the amount of time it takes a browser to create a connection to the server and start downloading the contents of a web page.
So is SQL query execution also a part of TTFB ?
Note : I am running the website on Windows server 2012 R2 with SQL server 2016 database.

Related

Why My web site time out while running JMeter load Test

I'm new to JMeter and. I followed this tutorial to learn JMeter.
I tried to do a load tested under following conditions.
Number of Threads (Users) - 1000
Ramp-Up Period (in seconds) - 10
Loop Count - 5
While I'm running the test, I tried to load my website (after clear cache)But, it takes more than usual time to load the page. This issue doesn't occur when the browser has cached data.
Can someone please tell me why this is happening? Is it because of when 1000 users load my site, it may crash or something?
Any kind of explanation will be appreciated.
While running your JMeter test if you try to load your website (after clear cache), it will always take more time to load than usual.It's because you have cleared the cache and now the browser needs to render the page resources again to load your desired page.After loading is complete and if you try to load the page again without clearing cache, it will take less time to load the page this time.Browser does not fetch page resources every time, rather the browser saves it in its cache.So next time when you try to open or load that page, the browser could use those cache to open that page for you in the shortest period of time. So for the first time when a browser load a page it takes more time than loading that specific page later(without clearing cache).
Another point is , as your Jmeter test was running while you tried to load your website, it will take a longer time to load your website.Because your application was already handling some requests send by JMeter.So handling extra load will impact on your website page response time.
Ramp up time 10sec for 1000 users!!!
It is not the best practice. You have to give enough time to warm up those 1000 users. 10 sec is too small to be the ramp up time for 1000 users.So during the JMeter test period, it is obvious that your browser will take an unexpected time to load your webpage(using Browser) or end up notifying "Connection Timeout".It necessarily doesn't mean that your application is crashed. It's simply because of unrealistic test script design in JMeter.
Could you elaborate on the type of webserver software you are using e.g?
- Apache HTTPD 2.4 / Nginx / Apache Tomcat / IIS
And the underlying operating system?
- Windows (Server?) / Mac OS X / Linux
If your webserver machine is not limited by the maximum performance of your CPU, Disk etc. (check the Task Manager) your performance might be limited by the configuration of Apache.
Could you please check the Apache HTTPD log files for relevant warnings?
Depending on your configuration (httpd.conf + any files "Include"d from there) you may be using the mpm_winnt worker, that has a configurable number of worker threads which by default is 64 according to:
https://httpd.apache.org/docs/2.4/mod/mpm_common.html#threadsperchild
Once these are all busy new requests from any client (your browser, your loadtest, etc.) will have to wait for their turn.
Try and see what happens if you increase the number of threads!

Issue with non responding website. How to debug?

We have a website created in asp-mvc4 running on iss on windows server 2012 and using MSSQL 2012 as data storage. Connections are done using entity framework-6... Very standard stuff.
We are not a high volume website (max 3000 users around the world so hitting it in different timezones)
The issue is that sometimes without warning the site becomes unresponsive (browser does not show it and time out). Nothing special but here is the strange issues:
The server itself is working fine if you terminal server into it
Restarting the ISS does not help er there are no error logs
SQL server have around 100 connections from the website all sleeping (but killing theses processes does not make the site recover)
SQL server at the time show half of them as waiting tasks but it is still responsive if executing sql from SSMS or even remote from excel (remote reporting)
Looking at SQL Profiler website is still sending in SQL request despite being down but they are all request like this: if db_id('dbname') is not null else select... (Not something specifically written in the website)
the really strange one: If we restart the SQL server the website becomes responsive again)
I know this is not a lot to go on but we are very puzzled and don't really know how to proceed. Northing indicate error in any kind of log (website, iss, sql server or windows). I can deduct it must be the website thinking SQL cannot give it what it need because connection pool or something is used up but why it is only freed up with a complete sql server restart and not just killing the processes really puzzles me, and why the connection pool buildup happen in the first place since and sql is handled in entity framework
Any advice on how to debug further is most welcome

some feature of application is not loading in production server sometime

We have an asp.net application where sqlserver 2012 is being used as back end.There is a tab called 'Screening' which can be used to search for data for different categories,let's say 'A'and'B'.'A' has 124 records and 'B' has 924 records.The screening section is always working fine for 'A' in production server.
however it may take more than 10 minutes or hours to load for 'B' in production server sometime,it was loading properly in production server with the same data till last two days(within 7 seconds) whereas it is always loading faster in test server.If we ran a query against a table in sql query browser with 'begin tran' and if it is not committed ,then our application features related to this table will not work until we are committing it. I am getting the same experience while i am trying to search the records of 'B' some time even none of our developers have logged into production database server in that moments.I am not sure why it is happening.The maximum number of users will work on this feature concurrently may be 10.It is occurring in some day and the issue may persist for few days and it may work properly in some day.

Neo4j slow loading

I'm crawling(using sampling API) twitter and saving the
crawled data into a Neo4j database.
When the total number of nodes exceed 20,000, my neo4j takes for ever to start.
It will just stoping at "...waiting for server to be ready ..." and nothing happens.
I normally wait for about 5~10 mins before I terminate the start, and so far I was unable to start process the server with that amount of node.
However, when I remove the "data" directory everything will start just fine.
I have inspected the neo4j.log file and found the following as well:
May 26, 2013 9:21:53 PM org.neo4j.server.logging.Logger log
INFO: Setting startup timeout to: 120000ms based on -1
I was wondering does Neo4j loads everything into memory during the service startup ?
What should I do to speed up the startup time of the service ?
One way is to check with initial memory recommendation using: https://neo4j.com/docs/operations-manual/current/tools/neo4j-admin-memrec/
And then change heap (it uses heap to store state of the graph along with query etc).

IIS 7.5 - Website needs restarting every morning

I have an Umbraco website that I have to restart every morning in order for the users to be able to publish content. Is there any solutions available that will help me get around doing this each morning?
1 - Document why do you "have to" restart IIS every morning
like the web app can't re-establish connection with SQL
or one process gets so huge that it's obvious it's leaking
or one process heats up with huge CPU usage and IIS keeps dropping requests
etc. etc. have to check log files, EventLog, SQL Server has it's own log
2 - Document usage patters of the site
like does it sit idle for 8-10 h or is busy all night
if it's busy then log files (including IIS log) will provide some info on when a problem started
if it's idle for a long time, check that AppPool for the site has automatic recycling of worker process set say after 1h of inactivity - you can also set diferent recycling tactics
if it's SQL connection after along idle period - Kerberos ticket for the account expired.
you do have a domain account under which that AppPool runs I hope
to fix that, look at DB connection string (normally in web.config) and check MSDN for params
or bring up a new web site or app that's going to keep pinging a web method which will just do a little query ( like a count on some table) and return the result as a kind of admin heartbeat -- this helps only if you acsually see SQL connection issue
3 - Check if you have multiple sites / web apps running on the server
that each has it's own AppPool and that they run under a domain account
that each app has it's own, separate folder for logs and any other writable files
that each AppPool has recycling tactics that's good for actual usage pattern
needs different recycling tactics if it's busy all the time
ask sor some mininal kind of heartbeat web service to be developed and pinged for ops needs
running as part of each web app and using the same SQL connection
if you don't have the budget for this raise some hell
makes you feel good :-)

Resources