Register FAQ Search Today's Posts Mark Forums Read

2015-04-02, 16:17   #914
Serpentine Vermin Jar

Jul 2014

2×1,637 Posts

Quote:
 Originally Posted by James Heinrich You could change the
method from "get" to "post" for immediate effect, which on the plus side gives the user a warning if they try to refresh to the page, but on the downside would cripple your ability to do what you did in perusing the logs to see what requests for assignments were made when. You could of course add additional internal logging at the (start of) the generate-assignments code, but that's more work to replicate what's currently captured in the httpd logs. You should put in a server-side check to prevent malicious people from bypassing your client-form limits. Easily done: change the one line in the code: Code: // was: //$found_assignments++; // change to: if ($found_assignments++ > (12*50)) { break; } Of course, putting the magic numbers into constants/variables in the code makes it easier to maintain.
Thanks, that might be useful. I saw the existing limit on the LL assignment request that forces it to no more than 2 per worker, so I thought about doing something similar either per worker or in aggregate like you suggest.

Regarding the comments from others about not being happy limiting this, bear in mind this is a limit on how many you can request at one time, and it has everything to do with server performance, not about artificially limiting how much work in total a user can have.

Later tonight I'm hoping to get a chance to peruse the assignment code and see if there are any ways to streamline. I see the function that does it, I just haven't actually looked at it at all.

Even if I find any possible ways to improve it, those are things I'd definitely want to have James and George consider because breaking that or doing something unintended would be "a very bad thing"

2015-04-02, 17:11   #915
Serpentine Vermin Jar

Jul 2014

2×1,637 Posts

Quote:
 Originally Posted by Madpoo Later tonight I'm hoping to get a chance to peruse the assignment code and see if there are any ways to streamline. I see the function that does it, I just haven't actually looked at it at all.
I took a quick peek at it for now... you know, the whole assignment process is really complicated. :)

It looks at a lot of different things when determining what to assign to specific users. I mean, it takes into account the confidence level of the computer, whether the user has opted to work on critical assignments, whether it's a new user with no history at all, etc.

Based on all of these inputs, it makes decisions on whether to return LL tests that may or may not need more factoring or hasn't had P-1 work done yet. It has to consult the table of exponent thresholds for different types and use that to set a range or limit any user selected range. Then it has to do this X amount of times for all the assignments being asked for. If this is done by the client, it looks at how many days it should take to complete each one and then hands out enough so that the client has enough, etc.

So... yeah, I guess 300ms per assignment doesn't seem that crazy after all.

What I'd have to focus on, rather than trying to reinvent the wheel there, are ways to optimize any particular steps along the way.

But I wanted to point out to everyone that the system George has in place is a bit more complex under the hood than you might expect. Be sure and thank him when you get the chance. It can't have been easy to get that all together in the first place. I suppose some of that would be Scott's work as well, and I don't know who else along the way has contributed, but they should all be recognized for their efforts.

2015-04-02, 17:33   #916
NBtarheel_33

"Nathan"
Jul 2008
Maryland, USA

5×223 Posts

Quote:
 Originally Posted by Madpoo I took a quick peek at it for now... you know, the whole assignment process is really complicated. :) It looks at a lot of different things when determining what to assign to specific users. I mean, it takes into account the confidence level of the computer, whether the user has opted to work on critical assignments, whether it's a new user with no history at all, etc. Based on all of these inputs, it makes decisions on whether to return LL tests that may or may not need more factoring or hasn't had P-1 work done yet. It has to consult the table of exponent thresholds for different types and use that to set a range or limit any user selected range. Then it has to do this X amount of times for all the assignments being asked for. If this is done by the client, it looks at how many days it should take to complete each one and then hands out enough so that the client has enough, etc. So... yeah, I guess 300ms per assignment doesn't seem that crazy after all. What I'd have to focus on, rather than trying to reinvent the wheel there, are ways to optimize any particular steps along the way. But I wanted to point out to everyone that the system George has in place is a bit more complex under the hood than you might expect. Be sure and thank him when you get the chance. It can't have been easy to get that all together in the first place. I suppose some of that would be Scott's work as well, and I don't know who else along the way has contributed, but they should all be recognized for their efforts.
The time and effort that George et al. have put into this project so that we users may not only efficiently participate, but also have fun doing so, is unbelievable. The fact that the system has evolved without breaking down completely or without everyone losing interest in the project, over nearly *two decades* (an eternity in the age of the Web), is an awesome testament to the effort and rigor that make it an honor to be involved in GIMPS.

Last fiddled with by NBtarheel_33 on 2015-04-02 at 17:34

2015-04-02, 17:44   #917
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

3·19·53 Posts

Quote:
 Originally Posted by Madpoo It looks at a lot of different things when determining what to assign to specific users... Based on all of these inputs, it makes decisions ... Then it has to do this X amount of times for all the assignments being asked for.
From my brief look at the code a while back I believe it does this completely independently for each assignment request. If so, one obvious optimization is to figure out what type of assignments are suitable for this user only once, and then fetch however many assignments meet that criteria.

But I know it's a big scary chunk of code that does many things, which is why I didn't dare touch it.

2015-04-02, 21:49   #918
flagrantflowers

Apr 2014

27 Posts

Quote:
 Originally Posted by NBtarheel_33 George et al. have put into this project
I would personally count you as part of that group. Without you I think it would have been a long ways off to a new server.

2015-04-02, 22:06   #919
Serpentine Vermin Jar

Jul 2014

1100110010102 Posts

Quote:
 Originally Posted by Madpoo I mocked up a few design-only changes to the manual assignment page: http://www.mersenne.org/manual_assig...fault.mock.php ...
I updated the mockup page above to show a running count of the total assignments being requested, and a rough guesstimate of how long it will take to generate.

Javascript is not something I'm familiar with at all. If you look at the source and the script seems a little kludgy, that's because I cut and paste some examples to do what I needed and shoe-horned it into the page. It works and that's all I care about.

2015-04-02, 22:42   #920
Serpentine Vermin Jar

Jul 2014

2·1,637 Posts

Quote:
 Originally Posted by James Heinrich From my brief look at the code a while back I believe it does this completely independently for each assignment request. If so, one obvious optimization is to figure out what type of assignments are suitable for this user only once, and then fetch however many assignments meet that criteria. But I know it's a big scary chunk of code that does many things, which is why I didn't dare touch it.
Absolutely right on both counts. It calls the whole set of things on each assignment (even though we would assume most of the information is the same from request to request, except "how many other assignments does this user/CPU have?"

And yeah, it's so complicated looking at first glance, I'm a little intimidated.

There probably needs to be some overhauling at some point. At least add something so it passes along a "how many assignments" to the function and it can skip a lot of the redundant stuff. The SQL query itself that gets them could just get a "top X" instead of "top 1", but that would entail updating everything that calls it to work with an array of results.

For now I'd be happy to find some micro-tweaks... optimizations in any step along the way that shaves a few milliseconds here and there.

After all, getting it from 300ms to 250ms per assignment...it starts to add up. Redesigning it entirely, I wouldn't be surprised if it took less than half the time, or a third of the time, but that's a pretty big investment in time there. And at least right now, aside from a few edge cases, it's just easier to "solve" it by trying to avoid it in the short term.

2015-04-06, 05:35   #921
snme2pm1

"Graham uses ISO 8601"
Mar 2014
AU, Sydney

3618 Posts

Quote:
 Originally Posted by Madpoo Regarding the comments from others about not being happy limiting this, bear in mind this is a limit on how many you can request at one time, and it has everything to do with server performance, not about artificially limiting how much work in total a user can have.
Please explain further, what is the real issue at stake?
Are you finding that the way that manual assignment allocation currently operates is blocking lots of other server activity?
That's ghastly if true, though I wouldn't have wanted to assume that.
If one were to attempt allocation of an extent of assignments, is the server neglecting to service other requisitions during that period rather then multithread portions of that request?
Earlier this day I did externally request serial assignment allocation for each of the unfactored bulk of 1,3xx,xxx, but it took a lengthy amount of real time, though I didn't need to watch thought the period.
I object to the alternative task of multiple error prone efforts of partial assignment of small extents, even if such were available in that region.
I want to reduce the need for my attendance at keyboard; sometimes I might press a wrong button.
Seriously, is the server more or less impacted by such alternative iterative and elongated communication, compared to fulfilling a large extent 100k brick as a single web page assignment request?
I suspect that most people are without a convenient facility to remotely request bulk assignments as I have just described.

2015-04-06, 06:05   #922
axn

Jun 2003

2×2,347 Posts

Quote:
 Originally Posted by snme2pm1 Please explain further, what is the real issue at stake?
Please read from post # 880 onwards to understand the context of this discussion.

 2015-04-06, 09:28 #923 S485122     Sep 2006 Brussels, Belgium 1,571 Posts Exponent Status Distribution errors ? Looking at the Exponent Status Distribution I see a few anomalies : In the 42M range there is one exponent more than there are primes in the range : the count (number of primes) should be equal to the sum of number of prime(s), composites and unproven exponents. I queried the database and it I found one less double-checked exponent (i.e.. 325 and not 326.) It must be a left over from the obfuscation at the time of the discovery of M(42643801) there was some work (P-1 and factoring) done after it was proven prime, see 42643801 status. In the status page of Mersenne primes the verifiers are not listed, perhaps they should be ? The full details of 43112609 for instance are empty. Then in the ranges 69M, 74M, 75M, 77M, 79M, 82M, 86M, 87M, 89M, 92M, 93M, 154M, 167M, 177M, 216M, 256M, 332M, 335M, 347M, 399M, 553M, 562M, 571M and 595M the total of unproven exponents is not equal to the total of assigned plus unassigned exponents : some exponents are missing. Finally some exponents must be doubly assigned in the the ranges 57M, 72M, 520M, 530M and 875M (but it could be just a problem of tallying while transactions are busy.) Jacob Last fiddled with by S485122 on 2015-04-06 at 09:47 Reason: Found some work done after primality discovery
2015-04-06, 14:07   #924
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

157608 Posts

I spot checked several of those counts this hour and they are OK.

Quote:
 Originally Posted by S485122 (but it could be just a problem of tallying while transactions are busy.)

That is the most likely cause. If you see the counts off several hours in a row, then we have a problem.

 Similar Threads Thread Thread Starter Forum Replies Last Post ewmayer Lounge 39 2015-05-19 01:08 ewmayer Science & Technology 41 2014-04-16 11:54 cheesehead Soap Box 56 2013-06-29 01:42 cheesehead Soap Box 61 2013-06-11 04:30 Dubslow Programming 19 2012-05-31 17:49

All times are UTC. The time now is 18:40.

Tue Sep 22 18:40:55 UTC 2020 up 12 days, 15:51, 1 user, load averages: 2.21, 1.93, 1.95