Closed
Bug 1456888
Opened 5 years ago
Closed 5 years ago
Use Linux filesystem type to decide about NSS SQL DB caching and speed measuring
Categories
(NSS :: Libraries, enhancement)
Tracking
(Not tracked)
RESOLVED
FIXED
3.38
People
(Reporter: KaiE, Assigned: KaiE)
References
Details
Attachments
(2 files, 1 obsolete file)
|
3.66 KB,
patch
|
rrelyea
:
review+
|
Details | Diff | Splinter Review |
|
3.60 KB,
patch
|
Details | Diff | Splinter Review |
As described in bug 1432484 users may experience slow NSS performance when storing the NSS SQL DB on a slow network filesystem. The workaround is to manually define environment variable NSS_SDB_USE_CACHE, which may be used to explicitly to automatically enable caching. Firefox has implemented bug 1444943 which enables caching automatically if the NSS DB is stored on an NFS filesystem. I like the approach that has been discovered in that Firefox bug, but I think the detection should be extended to cover a wider set of filesystems (not just NFS), and in addition I think the filesystem type check should be done at the NSS code level, to help as many applications as possible,
| Assignee | ||
Comment 1•5 years ago
|
||
Initial patch for discussion. Only Linux so far.
Assignee: nobody → kaie
| Assignee | ||
Updated•5 years ago
|
Summary: Enable NSS SQL DB caching on network filesystems without probing → Use Linux filesystem type to decide about NSS SQL DB caching and speed measuring
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 2•5 years ago
|
||
Attachment #8971162 -
Flags: review?(rrelyea)
| Assignee | ||
Updated•5 years ago
|
Attachment #8970910 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•5 years ago
|
||
The current patch focuses on Linux. I understand the Windows code is still being worked on in 1444511. We could further update the NSS code at a later time, after the Windows logic in Firefox was completed.
| Assignee | ||
Comment 4•5 years ago
|
||
try build seems fine: https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=664303b01a577519a20121d0aa774ac7aa5dd9a6
Comment 5•5 years ago
|
||
Comment on attachment 8971162 [details] [diff] [review] 1456888-v2.patch Review of attachment 8971162 [details] [diff] [review]: ----------------------------------------------------------------- The code is correct as is. I've made a few comment you can choose to address or not. bob ::: lib/softoken/sdb.c @@ +1953,5 @@ > + case NFS_SUPER_MAGIC: > + /* We assume these are slow. */ > + enableCache = PR_TRUE; > + break; > + case AFS_SUPER_MAGIC: I would expect AFS is actually enableCache=PR_FALSE. AFS does full file caching, which means once you've read the file it's there in your local filesystem, so there isn't a per access cost. OTOH, AFS is rare enough, measuring the output is fine. (actually if you are really sharing the file on AFS, then there is reason to believe sqlite will run into cache consistency issues because AFS doesn't write changes back until close, so it's universally recognized as inappropriate for database access. @@ +1970,5 @@ > +#endif > + } > + > + /* If we have already decided to enable caching, then we don't measure. */ > + if (!enableCache && measureSpeed) { Don't need to check for !enableCache. We only set measureSpeed if we haven't dealt with the cache. (that is when we know we want to do the automatic access we always set measureSpeed explicitly, so the !enableCache is a noop).
Attachment #8971162 -
Flags: review?(rrelyea) → review+
| Assignee | ||
Comment 6•5 years ago
|
||
Thanks for the review. I'll add Bob's requested changes.
| Assignee | ||
Comment 7•5 years ago
|
||
| Assignee | ||
Comment 8•5 years ago
|
||
https://hg.mozilla.org/projects/nss/rev/5a210945d248
Target Milestone: --- → 3.38
| Assignee | ||
Updated•5 years ago
|
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•