AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-29022

pstanton's questions

Martin Hope
pstanton
Asked: 2021-02-05 02:21:19 +0800 CST

tail -F 有时仍然会在 logrotate 上停止

  • 1
Linux ip-10-10-64-122 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14
23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

我tail -F在一个 bash 脚本中使用,该脚本反过来循环结果。该脚本应该无限期运行

tail -F /tmp/my.log |
grep --line-buffered "xyz" |
while read i
do
    echo "$i"
done
echo "end of read"

然而,虽然有时它通过 logrotate 工作,但有时它不会:

tail: '/tmp/my.log' has become inaccessible: No such file or directory

在这种情况下,我看不到“读取结束”意味着尾部/同时仍在运行/卡住。我可以确认日志文件确实在 logrotate 后在几毫秒内恢复到位,正如您所期望的那样。

日志旋转配置:

/tmp/mosquitto.log {
            rotate 500
            compress
            maxsize 40M
            nocreate
            missingok
            postrotate
                    /usr/bin/killall -HUP mosquitto
            endscript
    }

我怎样才能强迫它继续尾随?

bash tail
  • 1 个回答
  • 252 Views
Martin Hope
pstanton
Asked: 2010-03-17 23:14:56 +0800 CST

在 ubuntu 上为 postgres 安装 zlib

  • 1

我已经在 ubuntu 上安装了 postgres 并且正在尝试执行 pg_dump 但收到错误消息:

“pg_dump:[archiver] 警告:请求的压缩在此安装中不可用 - 存档将被解压缩”

我读过这是因为我没有安装 zlib 和 postgres。

既然已经安装了 postgres,我该如何为 postgres 安装 zlib?

谢谢。

编辑:命令:

pg_dump myDb -U myUser --schema=public --format=c --compress=9 > somefile.dmp

这是因为--format = c,但我想压缩它(默认情况下自定义(c)会这样做)。

ubuntu postgresql
  • 2 个回答
  • 2341 Views
Martin Hope
pstanton
Asked: 2010-02-05 15:49:56 +0800 CST

如何调整 postgres 以避免此错误?

  • 7

我收到错误

错误:无法写入临时文件的块 3478284:设备上没有剩余空间

运行以下查询时:

INSERT INTO summary SELECT t1.a, t1.b, SUM(t1.p) AS p, COUNT(t1.*) AS c,
    t1.d, t1.r, DATE_TRUNC('month', t1.start) AS month, t2.t AS t, t2.h, t2.x
FROM raw1 t1, raw2 t2
WHERE t1.t2_id=t2.id AND (t2.t<>'a' OR t2.y) GROUP BY month, t, a, b, d, r, h, x

表 t1 非常大,表 t2 非常大

Caused by: org.postgresql.util.PSQLException: ERROR: could not write block 3478284 of temporary file: No space left on device
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)

任何提示表示赞赏。

postgresql
  • 4 个回答
  • 26845 Views
Martin Hope
pstanton
Asked: 2010-02-01 20:29:24 +0800 CST

postgres 内存分配调优2

  • 0

我有一个 12Gb 内存的 Ubuntu Linux 系统,其中大部分(至少 10Gb)可以单独分配给 postgres。该系统还有一个 6 磁盘 15k SCSI RAID 10 设置。

我试图优化的过程是双重的。

首先,单线程、单连接将对通过外键链接的 2-4 个表进行多次插入。

其次,针对结果数据运行许多不同的复杂查询,广泛使用 group by。这部分尤其需要优化。

为了利用四核 CPU,我同时运行了四个这样的进程,因此通常不会有超过 5 个并发连接(1 个备用用于管理任务)。

您建议对默认 Postgres 配置进行哪些配置更改?

我正在寻找诸如 work_mem、shared_buffers 等的最佳值。

相关文档

谢谢!

memory postgresql
  • 3 个回答
  • 1411 Views
Martin Hope
pstanton
Asked: 2010-01-08 05:58:31 +0800 CST

linux下java内存分配

  • 2

我正在使用以下命令运行 4 个 java 进程:

java -Xmx256m -jar ...

并且系统在fedora 12下有8Gb内存。

但是它显然正在交换。

如果 4 x 256m = 1Gb 怎么办?

编辑:另外,所有 8Gb 的内存怎么能用这么少的内存分配给基本上唯一运行的东西?

java不是垃圾收集是因为操作系统告诉它不需要还是什么?


最佳:

top - 20:13:57 up  3:55,  6 users,  load average: 1.99, 2.54, 2.67
Tasks: 251 total,   6 running, 245 sleeping,   0 stopped,   0 zombie
Cpu(s): 50.1%us,  2.9%sy,  0.0%ni, 45.1%id,  1.1%wa,  0.0%hi,  0.8%si,  0.0%st
Mem:   8252304k total,  8195552k used,    56752k free,    34356k buffers
Swap: 10354680k total,    74044k used, 10280636k free,  6624148k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1948 xxxxxxxx  20   0 1624m 240m 4020 S 96.8  3.0 164:33.75 java
 1927 xxxxxxxx  20   0  139m  31m  27m R 91.8  0.4  38:34.55 postgres
 1929 xxxxxxxx  20   0 1624m 200m 3984 S 86.2  2.5 183:24.88 java
 1969 xxxxxxxx  20   0 1624m 292m 3984 S 65.6  3.6 154:06.76 java
 1987 xxxxxxxx  20   0  137m  29m  27m R 28.5  0.4  75:49.82 postgres
 1581 root      20   0  159m  18m 4712 S 22.5  0.2  52:42.54 Xorg
 2411 xxxxxxxx  20   0  309m 9748 4544 S 20.9  0.1  45:05.08 gnome-system-mo
 1947 xxxxxxxx  20   0  137m  28m  27m S 13.3  0.4  44:46.04 postgres
 1772 xxxxxxxx  20   0  135m  25m  25m S  4.0  0.3   1:09.14 postgres
 1966 xxxxxxxx  20   0  137m  29m  27m S  3.0  0.4  64:27.09 postgres
 1773 xxxxxxxx  20   0  135m  732  624 S  1.0  0.0   0:24.86 postgres
 2464 xxxxxxxx  20   0 15028 1156  744 R  0.7  0.0   0:49.14 top
  344 root      15  -5     0    0    0 S  0.3  0.0   0:02.26 kdmflush
    1 root      20   0  4124  620  524 S  0.0  0.0   0:00.88 init
    2 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0
    4 root      15  -5     0    0    0 S  0.0  0.0   0:00.04 ksoftirqd/0
java linux memory
  • 4 个回答
  • 4249 Views
Martin Hope
pstanton
Asked: 2010-01-07 16:28:13 +0800 CST

fedora 停止 - 不知道为什么

  • 0

昨天买了一台全新的服务器(IBM x3500),在上面安装了 Fedora 12,并认为我们应该运行一些代码来看看它的性能。

运行大约 7 小时后,系统似乎已停止。

症状是 - 风扇仍在运行,即系统听起来像是在运行 显示器、鼠标和键盘未通电并被禁用。cd 托盘仍然打开/关闭。链接灯闪烁。

我的第一个想法是温度,但找不到任何有关温度的信息/日志。

重新启动后,我似乎找不到任何看起来像系统日志的日志文件。

你会在哪里寻找原因?

编辑:更多信息

刚刚再次发生,在类似的情况下。

3.5 小时进入一个繁重的程序:流行!

当时我确实有一个“顶部”:

top - 15:26:41 up  4:26,  4 users,  load average: 2.67, 2.38, 2.37
Tasks: 246 total,   3 running, 243 sleeping,   0 stopped,   0 zombie
Cpu(s): 48.2%us,  1.5%sy,  0.0%ni, 48.4%id,  1.1%wa,  0.0%hi,  0.9%si,  0.0%st
Mem:   8252304k total,  8192272k used,    60032k free,    23592k buffers
Swap: 10354680k total,   146024k used, 10208656k free,  6350148k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 3934 pstanton  20   0 1881m 322m 3900 S 99.5  4.0 141:57.88 java
 3894 pstanton  20   0 1881m 336m 3896 S 95.2  4.2 169:54.01 java
 3914 pstanton  20   0 1881m 315m 3936 S 84.6  3.9 151:52.13 java
 3875 pstanton  20   0 1881m 271m 3948 S 73.3  3.4 179:25.13 java
 3893 pstanton  20   0  317m 208m 206m S 31.2  2.6  33:22.98 postgres
 3932 pstanton  20   0  317m 208m 206m S 16.9  2.6  63:02.05 postgres
 3912 pstanton  20   0  317m 208m 206m R  6.6  2.6  43:27.91 postgres
 4292 pstanton  20   0  325m  13m 4032 S  1.3  0.2   0:00.37 postgres
 4288 pstanton  20   0  325m  22m  12m S  0.7  0.3   0:03.45 postgres
   59 root      15  -5     0    0    0 S  0.3  0.0   0:03.81 ata/1
  358 root      15  -5     0    0    0 S  0.3  0.0   0:04.54 kjournald2
 1585 root      20   0  165m 7204 2168 S  0.3  0.1   1:37.06 Xorg
 2002 root      20   0 42192  380  308 S  0.3  0.0   0:04.03 devkit-disks-da
 3968 pstanton  20   0  288m 7280 3760 S  0.3  0.1   0:02.08 gnome-terminal
 4291 pstanton  20   0  325m  13m 4076 S  0.3  0.2   0:01.41 postgres
 4337 pstanton  20   0 15036 1244  848 R  0.3  0.0   0:00.09 top
    1 root      20   0  4056  596  492 S  0.0  0.0   0:00.91 init

我可以看到我正在使用不好的交换内存,但这不应该停止服务器?

此外,这一次我已经插入了键盘、鼠标和显示器,并且键盘和鼠标有电,但显示器是空白的(甚至没有光标)。

physical-environment fedora ibm
  • 3 个回答
  • 261 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve