tracker issue : CF-3036835

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 73802:Can we please get some reporting (in the debug output, or via logging) of how much time a given request spends in cflock waits? We don't hear call about this, but I would argue it's because few unders

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Charlie Arehart / charlie arehart (Charlie Arehart)

Created: 11/26/2008

Components: Debugging, General

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 20

Problem:

Can we please get some reporting (in the debug output, or via logging) of how much time a given request spends in cflock waits? We don't hear call about this, but I would argue it's because few understand what cflock waits are about.

I frequently help folks who have poor performing pages that are due to waits for attaining CFLOCKs. We can only determine it by timing the code with the locks there or not (and no, for readers who may suggest that throwontimeout=no is the answer, it's not. More on that in a moment).

All I'm proposing is a CF Admin setting on the debugging settings page (like the option of whether to track query times) which would report then at end of page how long the request spent in lock waits. This should be easy: the CFLOCK tag already has a timeout attribute, so CF pays attention to how long it waits to obtain the lock (and no, for readers who think that controls how long the code within the lock should be allowed to take, it does not.)

I'd just want to then see a list in the debugging output of the time spent. It would be great to detail it by CFLOCK (just as query time is shown per cfquery). But I would especially like to see it totalled (I'd like to see CFQUERY times totalled also, but that will be a separate request).

I would also request separately that we have a report in the debug output of how many cflock timeouts were encountered. Again, one may think that a cflock timeout throws an error, but that's controllable with throwontimeout=no, so we really do need to track this. (And anyway, one could catch the timeout in try/catch and handle it otherwise, so a timeout may not create an error.)  Knowing how often one has timeouts can be as valuable as knowing the total time spent in lock waits.

I would also argue we also need to be shown how many timeouts are in fact being ignored by the throwontimeout=no. That attribute/value combination is just devastating to those who don't understand it. So many who use it don't realize that it means that the code within the cflock WILL NOT BE EXECUTED if the lock is not obtained. So many people don't understand locking at all, so this confusion just exacerbates the problem of ignoring a timeout when it does happen.

And besides the debugging output, it would also be useful to be able to have this information logged, for admins to manage this when coders don't think to. Just like we have an option to log pages that exceed a given timeout, I might propose we also have an option to log pages whose total time in lock waits exceeds a given time. I realize some may blanch at this, because they think that the current "page too long" log report is enough, but I disagree. Some people accept that some pages take a long time due to the work they need to do, but I'm trying here to highlight problems that are OUTSIDE the scope of what the page is "expected" to be doing. My whole point is that many don't realize how much lock wait contention is adding time burden to their pages. We have no exposure of it.

And besides that logging, it might be nice to have an option to log the details per request, just like we have the option for cftrace stuff to go to a log in addition to the debugging output, for those who do not choose to enable debugging output but might still want to see the details per request.

Finally, I would ask that the Server Monitor and Admin api also both reflect this sort of info, just as they track query time in a page. Again, Admins sometimes are the ones who need to help developer understand the problem. But this can't be only in the monitor, because developers do need to see this info, just like query and trace timing, whether in the debug output or in a log.

And all this is all the more important to be tracked in other than the debugging output, because locking problems tend to happen only in production with multiple users. People don't tend to enable debugging output in production (and shouldn't, even if limited to certain ip addresses, for a variety of reasons that have long been discussed.) So having this info logged or in the Admin API would be all the more important.

PS If you really want to make this powerful, and you do track total lock time per request, it would be helpful to break down the total time in lock waits between the kind of locks (session, application, server, named lock, or the new "request" type added in CF8.01 for work with CFTHREAD), so that one may choose to focus on problems due to a certain kind of cflock wait (separate from each specific lock type).
Method:


Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3036835

External Customer Info:
External Company:  
External Customer Name: charlie arehart
External Customer Email: 03D0090C44723473992015D5
External Test Config: 11/26/2008

Attachments:

Comments:

This bug has been voted..
Vote by External U.
24649 | November 10, 2011 07:03:24 PM GMT
This bug has been voted..
Vote by External U.
24650 | November 10, 2011 07:03:25 PM GMT
This would be an excellen tool to help identifying issue in application and system performance. +10,000 :-)
Vote by External U.
24651 | November 10, 2011 07:03:26 PM GMT
This bug has been voted..
Vote by External U.
24652 | November 10, 2011 07:03:27 PM GMT
This bug has been voted..
Vote by External U.
24653 | November 10, 2011 07:03:28 PM GMT
This is a fantastic idea - what a great thing this would have been to have back when we had to CFLOCK every access to a session var! I'm especially in favor of the logging ideas, exactly for the reasons that Sean gives - production systems don't (shouldn't) be showing debug data, and even if they did you'd turn it off for the very people (end users) that are most likely to induce odd locking situations.
Vote by External U.
24654 | November 10, 2011 07:03:29 PM GMT
Would be great provided that implementing it doesn't slow down locking when the logging is off
Vote by External U.
24655 | November 10, 2011 07:03:29 PM GMT
This would be a great help in identifying lock-based bottlenecks in CFML code!
Vote by External U.
24656 | November 10, 2011 07:03:30 PM GMT
This bug has been voted..
Vote by External U.
24657 | November 10, 2011 07:03:31 PM GMT
This bug has been voted..
Vote by External U.
24658 | November 10, 2011 07:03:32 PM GMT
Seems like this could really help trouble shooting issues which might help turns people perception that CF is difficult to trouble shoot when this types of issues come up.
Vote by External U.
24659 | March 01, 2012 09:30:28 AM GMT
+1 This would be a great enhancement that would assist to show lock-based bottlenecks.
Vote by External U.
24660 | October 16, 2013 08:59:34 AM GMT
This is difficult to track in other ways and would be very helpful in performance optimization.
Vote by External U.
24661 | October 27, 2014 02:06:59 PM GMT
Vote must be between 25 and 4000 charactersVote must be between 25 and 4000 characters
Vote by External U.
24662 | August 27, 2015 03:22:34 PM GMT
I imagine - one day - someone will come to this bug tracker and see the 5000 or so votes where people have put in dummy text and say, "Hey, maybe we can let people vote without forcing them to write silly text. Maybe we could do that in 2 minutes of work or so since ColdFusion is so easy. Like, maybe we can just comment out the check." Yes - that is my dream.
Vote by External U.
24663 | August 27, 2015 04:58:31 PM GMT
Not sure how to change the name associated w/ my vote, but just noting I've already voted as 'itisdesign'. This cflock reporting would be very helpful - we could just open CF's Server Monitor and see what locks are open and for how long. Thanks!, -Aaron
Comment by External U.
24648 | August 27, 2015 06:45:33 PM GMT
This feature would allow me to see which locks are being hold open, very important for debugging!
Vote by External U.
24664 | August 28, 2015 01:41:14 AM GMT
Being able to see lock status would be an ideal addition to ACF and would make debugging lock contention much, much easier. +1
Vote by External U.
24665 | August 28, 2015 04:27:28 AM GMT
This would really be helpful. Even if just a few of the things that are carefully described here were implemented.
Vote by External U.
24666 | January 27, 2016 10:31:27 AM GMT
This remains unresolved, now 10 years later. :-(
Comment by Charlie A.
29613 | August 24, 2018 08:26:32 PM GMT