Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
huataihuang committed Aug 29, 2023
1 parent 8f6c951 commit 3c05a27
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/clang/parallel_make.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

我想起来当时编译时确实发现只有一个 ``cc1plus`` 进程运行,完全浪费了多cpu core的高性能服务器资源。当时因为只处理一台编译,也就没有再尝试优化。

没有启用 ``-j XX`` 参数 :ref:`` 耗时:
没有启用 ``-j XX`` 参数 :ref:`upgrade_gcc_on_centos7` 耗时:

.. literalinclude:: parallel_make/build_gcc_before_parallel_time
:caption: 没有启用 ``-j XX`` 参数之前编译gcc 耗时
Expand Down
5 changes: 3 additions & 2 deletions source/devops/docs/mkdocs/mkdocs_chinese_search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ MkDocs中文搜索
配置MkDocs中文搜索
=========================

- 安装 `jieba "结巴"中文分词 <https://pypi.org/project/jieba/>`_ 模块::
- 安装 `jieba "结巴"中文分词 <https://pypi.org/project/jieba/>`_ 模块:

pip install jieba
.. literalinclude:: mkdocs_chinese_search/jieba
:caption: 安装 ``jieba`` 模块

- 在 ``mkdocs.yml`` 中配置 ``separator`` ::

Expand Down
1 change: 1 addition & 0 deletions source/devops/docs/mkdocs/mkdocs_chinese_search/jieba
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install jieba
1 change: 1 addition & 0 deletions source/devops/docs/sphinx_doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Sphinx文档
sphinx_rss_feed.rst
sphinx_embed_video.rst
sphinx_embed_youtube.rst
sphinx_chinese_search.rst
sphinx_typeerror.rst
rtd_fail_import_extension.rst
sphinx_disqus.rst
Expand Down
29 changes: 29 additions & 0 deletions source/devops/docs/sphinx_doc/sphinx_chinese_search.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. _sphinx_chinese_search:

===================
Sphinx中文搜索
===================

- 和 :ref:`mkdocs_chinese_search` 一样,采用 jieba 类库:

.. literalinclude:: ../mkdocs/mkdocs_chinese_search/jieba
:caption: 安装 ``jieba`` 模块

- 修改 ``conf.py`` 配置,将项目设置为中文,或者html搜索语言设置为中文:

.. literalinclude:: sphinx_chinese_search/conf.py
:language: python
:caption: 配置Sphinx ``conf.py`` 设置项目为中文

- 可选配置:

.. literalinclude:: sphinx_chinese_search/conf_jieba_dict.py
:language: python
:caption: 可选配置 ``jieba`` 词典路径



参考
=====

- `SPHINX-DOC的中文搜索 <https://www.cnblogs.com/chunyin/p/9610857.html>`_
2 changes: 2 additions & 0 deletions source/devops/docs/sphinx_doc/sphinx_chinese_search/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language = 'zh_CN'
#html_search_language = 'zh'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
# html_search_options = {'dict': '/usr/lib/jieba.txt'} # 根据需要设置jieba的词典路径
2 changes: 2 additions & 0 deletions source/devops/docs/write_doc/install_sphinx_doc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pip install sphinx
pip install sphinx_rtd_theme
pip install sphinxnotes-strike

# 支持视频、YouTube和中文搜索,安装组件和配置
11 changes: 10 additions & 1 deletion source/docker/images/docker_image_prune.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Docker清理镜像
======================

在生产环境长期运行的容器服务器,你会发现磁盘空间越来越少,例如 :ref:`trace_disk_space_usage`_ :
在生产环境长期运行的容器服务器,你会发现磁盘空间越来越少,例如 :ref:`trace_disk_space_usage` :

.. literalinclude:: ../../shell/bash/trace_disk_space_usage/du_large_dir
:caption: 查找消耗磁盘空间最大的目录
Expand Down Expand Up @@ -47,7 +47,16 @@ Docker清理镜像

这里虽然使用 ``rmi`` 删除所有镜像,但是实际上如果正在使用的 image 是不会删除的,只会提示一个无法删除信息。遮掩,实际上就完成了无效镜像的清理。

``prune`` 一切
================

``docker`` 提供了更多的清理选项,可以用来清理容器,卷,网络甚至一切:

.. literalinclude:: docker_image_prune/docker_prune
:caption: 可以使用 ``docker`` 的 ``prune`` 多种资源,甚至一切

参考
=======

- `Prune unused Docker objects <https://docs.docker.com/config/pruning/>`_
- `How to remove old and unused Docker images <https://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images>`_ 这里有更多案例以及说明,如有需要可以参考
21 changes: 21 additions & 0 deletions source/docker/images/docker_image_prune/docker_prune
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 清理容器
docker container prune
# 如果要强制完成,则增加 ``-f`` 或 ``--force`` 参数
# 可以使用过滤功能: 例如清理最近24小时前的已经停止的容器
docker container prune --filter "until=24h"

# 清理卷
docker volume prune
# 默认是删除所有没有使用的卷,可以过滤,例如有标签keep的需要保留
docker volume prune --filter "label!=keep"

# 清理网络
docker network prune
# 清理24小时以上没有使用的网络
docker network prune --filter "until=24h"

# 清理一切,默认不包括卷
docker system prune
# 清理一切,并且包括卷也清理
docker system prune --volumes

0 comments on commit 3c05a27

Please sign in to comment.