我何时选择部署为JBoss SAR而不是EAR?
这是一个更普遍的问题,我正在寻找解释每个部署模型的优缺点的指南,以及哪一个适用.
我有maven项目.我的耳档包括jar和war.他没有错误地构建.当我尝试将.sar包添加到项目时,问题就开始了.他还没有建设.他抛出异常.我说,如果你知道使用MBean的其他方法,我需要使用sar存档来使用MBean.因为我是jmx的新手.
Pom层次结构:
pom.xml(super)
--pom.xml(ear)
--pom.xml(war)
--pom.xml(jar)
--pom.xml(sar)
Run Code Online (Sandbox Code Playgroud)
Sar层次结构:
src
--main
----java
------org.myproject
--------MyMBean.java
--------MyService.java
----resources
------META-INF
--------jboss-service.xml
pom.xml
Run Code Online (Sandbox Code Playgroud)
超级pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.myproject</groupId>
<artifactId>logic</artifactId>
<version>2.0</version>
<packaging>pom</packaging>
<properties>
<logic.version>2.0</logic.version>
<modul-jar.version>2.0</modul-jar.version>
<logic-ear.version>2.0</logic-ear.version>
<web-war.version>2.0</web-war.version>
</properties>
<modules>
<module>modul-jar</module>
<module>logic-ear</module>
<module>web-war</module>
<module>mbean-sar</module>
</modules>
</project>
Run Code Online (Sandbox Code Playgroud)
耳朵:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>logic</artifactId>
<groupId>org.myproject</groupId>
<version>2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>logic-ear</artifactId>
<groupId>org.myproject</groupId>
<version>2.0</version>
<packaging>ear</packaging>
<dependencies>
<!-- war ejb sar -->
<dependency>
<artifactId>web-war</artifactId>
<groupId>org.myproject</groupId>
<version>2.0</version>
<type>war</type>
</dependency>
<dependency>
<artifactId>modul-jar</artifactId>
<groupId>org.myproject</groupId>
<version>2.0</version> …Run Code Online (Sandbox Code Playgroud) 我对shell编程比较陌生,想知道是否有一种简单的方法可以将sar命令的结果输出到csv文件中.使用sar > file1.csv完成工作,但格式不正确.所有数据都存在于一列中.我试过这个,但情况更糟
sar -d -u -w 1 1 | grep -v Average | grep -v Linux | tr -s ' ' ',' | tr -d '\n' > file1.csv
Run Code Online (Sandbox Code Playgroud)
任何人都可以给我正确的脚本来将sar命令的输出存储在一个csv文件中.帮助将不胜感激.
通过阅读3D游戏编程大师的技巧,我遇到了这种用内联汇编编写的排序函数:
inline float FastSqrt(float Value)
{
float Result;
_asm
{
mov eax, Value
sub eax, 0x3F800000
sar eax, 1
add eax, 0x3F800000
mov Result, eax
}
return(Result);
}
Run Code Online (Sandbox Code Playgroud)
它是实际平方根的近似值,但精度足以满足我的需要.
这实际上是如何工作的?这个神奇的0x3F800000价值是什么?我们如何通过减法,旋转和添加来实现平方根?
以下是它在C/C++代码中的外观:
inline float FastSqrt_C(float Value)
{
float Result;
long Magic = *((long *)&Value);
Magic -= 0x3F800000;
Magic >>= 1;
Magic += 0x3F800000;
Result = *((float *)&Magic);
return(Result);
}
Run Code Online (Sandbox Code Playgroud) 我知道这个sar的例子,sar -u 1 3它以1秒的间隔给出接下来3秒的统计数据.
然而,sar还继续在后台收集信息(我的cron设置为每分钟收集统计数据).有什么方法我可以简单地使用sar命令查询最后5分钟的统计数据及其平均值.
现在我正在使用以下命令
interval=5; sar -f /var/log/sysstat/sa22 | tail -n $interval | head -n -1 | awk '{print $4+$6}'| awk '{s+=$1} END {print s/$interval}'
Run Code Online (Sandbox Code Playgroud)
检查最近5分钟的整体CPU使用情况.
有没有更好的办法 ?
我正在使用这个命令:
sar 1 | tail -n +3
Run Code Online (Sandbox Code Playgroud)
它输出以下内容(每 1 秒一次,我在几秒钟后中断它):
root@debian:/home/hyper/stats# sar 1 | tail -n +3
20:00:04 CPU %user %nice %system %iowait %steal %idle
20:00:05 all 0,25 0,00 0,50 0,00 0,00 99,25
20:00:06 all 0,50 0,00 0,25 0,00 0,00 99,25
20:00:07 all 4,79 0,00 1,01 0,00 0,00 94,21
20:00:08 all 0,75 0,00 0,75 0,75 0,00 97,74
20:00:09 all 1,26 0,00 0,76 0,00 0,00 97,98
20:00:10 all 0,75 0,00 0,50 0,00 0,00 98,74
^C
Run Code Online (Sandbox Code Playgroud)
问题是当我尝试将此输出写入文件时。我尝试过:
sar 1 | tail -n …Run Code Online (Sandbox Code Playgroud) 我试图在卫星SAR图像中去除斑点噪声.我没有得到任何在SAR图像中去除散斑噪声的包.我已经尝试过pyradar,但它适用于python 2.7,我在Windows上运行带有python 3.5的Anaconda.此外,Rsgislib可用,但它在Linux上.Joseph meiring还在github上提供了一个Lee过滤器代码,但它无法正常工作.:https: //github.com/reptillicus/LeeFilter
请问,任何人都可以共享斑点滤波器的python脚本或如何在python中进行散斑滤波器设计.
我已经反汇编了编译器生成的代码,并且看到它生成了以下指令序列:
mov eax, edx
shr eax, 1Fh
add eax, edx
sar eax, 1
Run Code Online (Sandbox Code Playgroud)
该代码的目的是什么?
我知道
sar eax, 1
Run Code Online (Sandbox Code Playgroud)
除以2,但是做什么
shr eax, 1Fh
Run Code Online (Sandbox Code Playgroud)
做?这是否意味着EAX如果左位为0或1,则为0或1?
这对我来说看起来很奇怪!有人可以解释吗?
Can I get memory usage per process with Linux? we monitor our servers with sysstat/sar. But besides seeing that memory went off the roof at some point, we can't pinpoint which process was getting bigger and bigger. is there a way with sar (or other tools) to get memory usage per process? and look at it, later on?
我想查看机器上/一般的磁盘I / O信息。从https://unix.stackexchange.com/questions/55212/how-can-i-monitor-disk-io找到了一些帮助
在最近安装sysstat软件包并尝试像该人一样使用sar命令(我假设)之后,系统提示我检查是否在上述指定的文件中启用了数据收集。
后:
sudo vim /etc/default/sysstat
Run Code Online (Sandbox Code Playgroud)
我更改了唯一的未注释代码行:
ENABLED="false"
Run Code Online (Sandbox Code Playgroud)
至:
ENABLED="true"
Run Code Online (Sandbox Code Playgroud)
但是,我仍然无法运行sar并无法在终端中获得预期的输出。
我正在为未来几天的更多流量做好准备,并且我想确保服务器能够处理它。
运行 sar -q,“3.5”的负载在 32 CPU 架构上似乎并不多:
但是,我不确定内存。
运行 sar -r 显示 %memused 为 98.5%,而 %commit 仅显示 13.60:
运行 htop 似乎也可以:14.9G/126G。这是否意味着在 126 个可用的 Gig 中,应用程序仅使用了 14.9 个 Gig?
我对 sar -r 输出更感兴趣。
%memused 看起来是98.5%,而 %commit 只有13.6% 我想知道这意味着什么。
sar ×11
linux ×5
assembly ×2
jmx ×2
monitoring ×2
optimization ×2
performance ×2
unix ×2
x86 ×2
bash ×1
cpu ×1
disassembly ×1
file ×1
imagefilter ×1
io ×1
java ×1
jboss ×1
maven ×1
mbeans ×1
memory ×1
python ×1
python-3.x ×1
shell ×1
square-root ×1
tail ×1