-
Notifications
You must be signed in to change notification settings - Fork 33
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
Viewing log in directories with thousands of files does not work, ends with Apache "504 Gateway Timeout" #148
Comments
Althogh 30 000 seems to be inefficient code, svnauthz is likely unavoidable because the every single file could be subject to authz. How fast is the default SVN view for this directory with 10 000 files? |
You should provide the exact link you are executing and for which you have seen all those Performance problems like these have been discussed in the past already, but from our point of view, using 8821af1#diff-5b6bdb07f82e491a5daf1f78b8afae0e1d995fa67a06f957e467a29460f404b1R100 |
Entering this directory takes about 3 seconds for viewing. That's OK. |
I start e.g. with the URL https://myserver.my.domain/websvn/browse/myrepo/trunk/dir_with_thousand_files/ |
Yes, please. This should be better. aI wonder whether we could utilize Redis somehow for this. The fundamental difference between WebSVN and SVN authz module is that we don't have access to the C API and the to exec which is compared slow. Maybe some knows how to properly call C from PHP and we could solve this problem. |
That would be great, especially have a look at foreach ($curLog->entries as $entryKey => $entry) {
$fullModAccess = true;
$anyModAccess = (count($entry->mods) == 0);
$precisePath = null;
foreach ($entry->mods as $modKey => $mod) {
$access = $this->repConfig->hasLogReadAccess($mod->path);
if ($access) { I suggest simply removing that check in favor of Have a look at var_dump to output things into HTML and afterwards simply copy the necessary data when looking at HTML source in your browser. |
I already started yesterday to find out where to insert some debug code. I updated from 2.6.1. to the current GIT code. After this change
it speeds it up and the log display is working.
Then I added the $cmd output to see the svn commands:
I don't know how to dump the XML results in PHP, but on the command line the first two svn commands are listing only the things related to the file myfile0001.txt, but the last one displays entries for all files from that directory. What can we do now? |
I've expected something like that. There's two aspects here:
For question 1, it might make sense to test how other clients behave, like TortoiseSVN or alike. Especially if access to some of the files is restricted and to some not. I've already seen that TSVN sometimes doesn't show log entries because of a lack of permissions, but am not sure how possibly unrelated files influence this. Besides that, you might want to ask on the SVN user mailing list about what's the correct behaviour. I simply don't know it as well. From my point of view, when the history of one concrete log file is of interest only, checking the permissions for only that file should be enough. But people might habe implemented this like it is for a reason. About performance: As long as external |
A deamon isn't necessary. I assume that the Apache module for authz loads the file at request time, holds in memory processes the request and frees as resources. This is basically what we need. |
This is what we need: |
I would say: To check all files in the revision basically is valid, but checking files in the same directory is obsolete. |
I'm pretty sure SVN maintains access to arbitrary paths:
https://svnbook.red-bean.com/en/1.7/svn.serverconfig.pathbasedauthz.html |
@loeschers |
@ams-tschoening You are right. Current SVN is able to resctrict access also on file basis. @michael-o I enabled Apache debug LogLevel and then executed something like that: This means as a result: The logic in WebSVN is correct. :-) But would be there a way to speed it up or at least avoid the Apache timeout? |
I see only two ways:
|
Avoiding the timeout is easy in theory, just set it high enough... ;-)
|
Hi!
Thanks for the great work!
I use WebSVN 2.6.1 and most things are working perfectly.
But when I want to view the log for a file, which is located in a directory with thousands of other files, it ends with the Apache error "504 Gateway Timeout".
I did some debugging and found out, that WebSVN is executing tons of commands like
svnauthz accessof --repository 'xxxxxx' --path '/trunk/myfiles/somefile.txt' --username '***' '/etc/httpd/conf.d/svn_rep_access'
This is done for each file in this directory at least three times.
With ~10.000 files in a directory, this leads to executing ~30.000 svnauthz commands, which leads to the timeout (IMO).
My basic question: Why is svnauthz executed for each file in that directory?
To my understanding, it should be enough to execute it only for this single file, for which the log was requested.
Is there a way to fix this?
BR,
Stephan.
The text was updated successfully, but these errors were encountered: