-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase IPP_MAX_VALUES #1284
Comments
CUPS.org User: mike Increasing IPP_MAX_VALUES only reduces the problem, it doesn't eliminate it, and it will increase the amount of memory that is needed for even small requests. I'll work up a more efficient implementation that caches the pointers so we don't need to do the list traversal all the time. |
CUPS.org User: mike Fixed in Subversion repository. I've attached a patch that works with CUPS 1.1.23 which adds a "prev" pointer to the ipp_t structure and changes the allocation increment (IPP_MAX_VALUES) to a power of two. The new code initially allocates 1 value and then resizes in IPP_MAX_VALUES increments. Let me know if you find a larger value of IPP_MAX_VALUES still works better. FWIW, make sure you also include the patch in STR #1249 (which fixes reading of collections...) |
CUPS.org User: twaugh.redhat Where can I find the patch? I'd like to try it out, but can't find the link to it. |
CUPS.org User: mike Sorry, here it is... |
CUPS.org User: mike Sorry, the patch is attached now... |
"str1284.patch": Index: ipp.c--- ipp.c (revision 4723) if (ipp->current)
ipp->current = NULL;
return (NULL);
-ipp_t * /* O - New IPP request /
if ((temp = (ipp_t )calloc(1, sizeof(ipp_t))) != NULL)
return (temp);
- DEBUG_printf(("ippReadIO: request_id=%d\n", ipp->request.any.request_id));
@@ -968,6 +980,9 @@
@@ -1022,7 +1040,8 @@
@@ -1089,10 +1110,8 @@ - for (ptr = ipp->attrs; ptr && ptr->next != attr; ptr = ptr->next);
@@ -1112,13 +1131,19 @@
- ipp->last = attr;DEBUG_printf(("_ipp_add_attr(): %p\n", attr)); return (attr);
|
Version: 1.1.23
CUPS.org User: twaugh.redhat
While analysing why CUPS cannot scale to 10000 queues, I discovered that a large amount of time is spent in ippReadIO(), here:
1052 /*
1053 * Reset pointers in the list...
1054 */
1055
1056 for (ptr = ipp->attrs; ptr && ptr->next != attr; ptr = ptr->next);
By increasng IPP_MAX_VALUES in ipp.h from 10 to 100 I avoided this scalability issue altogether.
The text was updated successfully, but these errors were encountered: