Sen2Agri-System icon indicating copy to clipboard operation
Sen2Agri-System copied to clipboard

Sen2Agri Processors installation must not modify some system files

Open savmickael opened this issue 8 years ago • 7 comments

In the CMakeLists.txt file of sen2agri-processors two system files ( /usr/lib/tmpfiles.d and /etc/security/limits.d) are modified during configuration of the project. It is not well adapted to do that here, it should be done during the installation of the system. Can you please move it to the right place.

savmickael avatar Nov 21 '17 10:11 savmickael

Just trying to understand this, are you saying that the files are installed during CMake configuration (i.e. when running cmake path/to/processors, or that they shouldn't be installed by the resulting package? I don't think it's the former.

As for the latter, I guess we could move them to the sen2agri-app package. Would that work for you?

lnicola avatar Nov 21 '17 14:11 lnicola

With the current version when I made a

make install

after configuration and build, it try to install these files in system paths. For me these files must not be installed by the package sen2agri_processors. I don't know the role of sen2agri-app package. Why you need to modify these system files ?

savmickael avatar Nov 21 '17 15:11 savmickael

Got it. The sen2agri-app package contains the orchestrator and other applications used in the automated mode.

The two changes are:

  1. Disabling transparent hugepages; during production we've noticed considerable slowdowns caused by this feature and a cursory Google search shows other similar reports. It might be possible to tune the THP defragmentation, but we haven't looked into it.

  2. Increasing the open file limit. This is required by the L4 processors because they tend to read a lot of input images at the same time. The default 1024/4096 file descriptor limit is not sufficient for larger sites.

lnicola avatar Nov 21 '17 15:11 lnicola

Anyway, if you're setting CMAKE_INSTALL_PREFIX to something different than / or /usr, I don't expect these files to cause permission denied errors.

lnicola avatar Nov 21 '17 15:11 lnicola

I agree with the last comments. Set the CMAKE_INSTALL_PREFIX hide the issue. However I am not convinced that the sen2agri-processors should change these system properties. I should be a set of prerequesite made by administrator and put in a README file. I understand that second point is related to processors but for the second I didn't understand if it is related to the processors. Honestly, I didn't understand the patch can you explain me more precisely.

savmickael avatar Nov 21 '17 21:11 savmickael

I understand that second point is related to processors but for the second I didn't understand if it is related to the processors.

I assume you meant to say that the first point is unclear, so I'll follow up on that explanation. Linux usually manages physical memory in 4 KB pages, but accounting for each of these pages consumes a bit of memory and time, and people with large systems (10s of GBs up to TBs of RAM, I assume) didn't like it.

This is how "huge pages" came to be, which are pages of 2 MB instead of 4 KB. Linux also has a feature where it continuously goes through the used memory and tries to defragment it and merge consecutive 4 KB pages into 2 MB ones, which is called "transparent hugepages" (THP).

This process in the background, but is sometimes detrimental for performance, either because the pages can't be merged, or because they get merged only to get split back again.

On our systems I noticed that the THP defrag process was consuming a lot of CPU time (although I don't recall the numbers) and slowing down the processing. Many other projects recommend disabling them, for example:

  • https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
  • https://docs.splunk.com/Documentation/Splunk/7.0.0/ReleaseNotes/SplunkandTHP
  • https://redis.io/topics/latency
  • https://alexandrnikitin.github.io/blog/transparent-hugepages-measuring-the-performance-impact/
  • http://underthehood.meltwater.com/blog/2015/04/14/riak-elasticsearch-and-numad-walk-into-a-red-hat/

At that time the simplest solution was to ship that file which disables THP unless requested by the applications. But I agree that it's not necessarily the Sen2Agri system's concern, so we should probably remove it, and leave that decision up to the users. But of course, the same argument applies to the other change (increasing the open file limit).

lnicola avatar Nov 22 '17 09:11 lnicola

It should be done during installation of the system and document somewhere in the SUM not in the CMakeLists.txt file. Thanks a lot for the explanation.

savmickael avatar Nov 22 '17 14:11 savmickael