首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >大型基础Opengrok的优化

大型基础Opengrok的优化
EN

Stack Overflow用户
提问于 2022-06-10 07:46:38
回答 1查看 157关注 0票数 0

我这里有一个服务器实例,它有4个核心,32 GB RAM和Ubuntu20.04.3LTS。在这台机器上有一个opengrok实例作为码头容器运行。

在码头容器内部,它使用AdoptOpenJDK:

代码语言:javascript
复制
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
Eclipse OpenJ9 VM AdoptOpenJDK-11.0.11+9 (build openj9-0.26.0, JRE 11 Linux amd64-64-Bit Compressed References 20210421_975 (JIT enabled, AOT enabled)
OpenJ9   - b4cc246d9
OMR      - 162e6f729
JCL      - 7796c80419 based on jdk-11.0.11+9)

扫描的代码库大小为320 GB,长达21小时。

我想到的是,我已经禁用了历史记录-选择它的时间更短。如果设置了历史标志,是否有可能减少这一次。

下面是我的index命令:

opengrok-indexer -J=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -J=-Djava.util.logging.config.file=/usr/share/tomcat10/conf/logging.properties -J=-XX:-UseGCOverheadLimit -J=-Xmx30G -J=-Xms30G -J=-server -a /var/opengrok/dist/lib/opengrok.jar -- -R /var/opengrok/etc/read-only.xml -m 256 -c /usr/bin/ctags -s /var/opengrok/src/ -d /var/opengrok/data --remote on -H -P -S -G -W /var/opengrok/etc/configuration.xml --progress -v -O on -T 3 --assignTags --search --remote on -i *.so -i *.o -i *.a -i *.class -i *.jar -i *.apk -i *.tar -i *.bz2 -i *.gz -i *.obj -i *.zip"

谢谢你提前提供帮助。

亲切的问候

齐格弗里德

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-10 13:04:46

您应该尝试使用以下选项来增加线程数:

代码语言:javascript
复制
  --historyThreads number
    The number of threads to use for history cache generation on repository level. By default the number of threads will be set to the number of available CPUs.
    Assumes -H/--history.
    
  --historyFileThreads number
    The number of threads to use for history cache generation when dealing with individual files.
    By default the number of threads will be set to the number of available CPUs.
    Assumes -H/--history.

   -T, --threads number
    The number of threads to use for index generation, repository scan
    and repository invalidation.
    By default the number of threads will be set to the number of available
    CPUs. This influences the number of spawned ctags processes as well.

看一看"renamedHistory“选项。理论上,"off“是默认选项,但这会对索引时间产生巨大影响,因此值得检查:

代码语言:javascript
复制
  --renamedHistory on|off
    Enable or disable generating history for renamed files.
    If set to on, makes history indexing slower for repositories
    with lots of renamed files. Default is off.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72570761

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档