2016年9月27日火曜日

[XenServer] UnixBench


 I was successful to install end execute UnixBench on  XenServer 6.5.\


○ Environment:

CPU : AMD FX-9590 (4.7 GHz)
Hypervisor : Citrix  XenServer 6.5
OS : Stretch (Debian)

Stretch is running with 2 CPUs And 2GB memory on XenServer.

○install UnixBench.

[root@servername ~]# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/byte-unixbench/UnixBench5.1.3.tgz
--2016-09-27 12:01:43--  https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/byte-unixbench/UnixBench5.1.3.tgz
Resolving storage.googleapis.com (storage.googleapis.com)... 74.125.23.128, 2404:6800:4008:c01::80
Connecting to storage.googleapis.com (storage.googleapis.com)|74.125.23.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 143259 (140K) [application/octet-stream]
Saving to: UnixBench5.1.3.tgz 2019

UnixBench5.1.3.tgz  100%[===================>] 139.90K   586KB/s    in 0.2s   

2016-09-27 12:01:45 (586 KB/s) - UnixBench5.1.3.tgz saved [143259/143259] [root@servername ~]#tar zxvf ./UnixBench5.1.3.tgz -C /usr/local/

○Execute UnixBench

[root@servername ~]# cd /usr/local/UnixBench
[root@servername ~]# ./Run
gcc -o ./pgms/arithoh -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Darithoh ./src/arith.c
gcc -o ./pgms/register -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum='register int' ./src/arith.c
gcc -o ./pgms/short -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=short ./src/arith.c
gcc -o ./pgms/int -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=int ./src/arith.c
gcc -o ./pgms/long -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=long ./src/arith.c
gcc -o ./pgms/float -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=float ./src/arith.c
gcc -o ./pgms/double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=double ./src/arith.c
gcc -o ./pgms/hanoi -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/hanoi.c
gcc -o ./pgms/syscall -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/syscall.c
./src/syscall.c: In function \u2018main\u2019:
./src/syscall.c:93:21: warning: null argument where non-null required (argument 2) [-Wnonnull]
                     execl("/bin/true", (char *) 0);
                     ^~~~~
gcc -o ./pgms/context1 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/context1.c
gcc -o ./pgms/pipe -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/pipe.c
gcc -o ./pgms/spawn -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/spawn.c
gcc -o ./pgms/execl -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/execl.c
In file included from ./src/execl.c:34:0:
./src/big.c: In function \u2018getwork\u2019:
./src/big.c:452:11: warning: variable \u2018c\u2019 set but not used [-Wunused-but-set-variable]
     char  c;
           ^
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c
gcc -o ./pgms/dhry2 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1.o ./src/dhry_2.o
cd ./src; rm -f dhry_1.o dhry_2.o
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c -o dhry_1_reg.o
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c -o dhry_2_reg.o
gcc -o ./pgms/dhry2reg -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1_reg.o ./src/dhry_2_reg.o
cd ./src; rm -f dhry_1_reg.o dhry_2_reg.o
gcc -o ./pgms/looper -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/looper.c
gcc -o ./pgms/fstime -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/fstime.c
gcc -o ./pgms/whetstone-double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -DDP -DUNIX -DUNIXBENCH ./src/whets.c -lm
make all
make[1]: Entering directory '/usr/local/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./results  exists
make[1]: Leaving directory '/usr/local/UnixBench'
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1
 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

2 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

2 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

2 x Execl Throughput  1 2 3

2 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

2 x File Copy 256 bufsize 500 maxblocks  1 2 3

2 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

2 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

2 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

2 x Process Creation  1 2 3

2 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

2 x Shell Scripts (1 concurrent)  1 2 3

2 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: BandaAceh: GNU/Linux
   OS: GNU/Linux -- 4.3.0-1-amd64 -- #1 SMP Debian 4.3.5-1 (2016-02-06)
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: AMD FX(tm)-9590 Eight-Core Processor (9380.0 bogomips)
          Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSCALL/SYSRET
   CPU 1: AMD FX(tm)-9590 Eight-Core Processor (9380.0 bogomips)
          Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSCALL/SYSRET
   12:46:36 up  1:07,  1 user,  load average: 3.27, 1.22, 0.60; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Tue Sep 27 2016 12:46:36 - 13:14:44
2 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       37698819.4 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     4648.1 MWIPS (9.7 s, 7 samples)
Execl Throughput                                946.5 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        316189.3 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           86468.0 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        828011.4 KBps  (30.0 s, 2 samples)
Pipe Throughput                              512535.0 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  63324.0 lps   (10.0 s, 7 samples)
Process Creation                               1725.9 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5501.0 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1055.3 lpm   (60.0 s, 2 samples)
System Call Overhead                         509390.6 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   37698819.4   3230.4
Double-Precision Whetstone                       55.0       4648.1    845.1
Execl Throughput                                 43.0        946.5    220.1
File Copy 1024 bufsize 2000 maxblocks          3960.0     316189.3    798.5
File Copy 256 bufsize 500 maxblocks            1655.0      86468.0    522.5
File Copy 4096 bufsize 8000 maxblocks          5800.0     828011.4   1427.6
Pipe Throughput                               12440.0     512535.0    412.0
Pipe-based Context Switching                   4000.0      63324.0    158.3
Process Creation                                126.0       1725.9    137.0
Shell Scripts (1 concurrent)                     42.4       5501.0   1297.4
Shell Scripts (8 concurrent)                      6.0       1055.3   1758.8
System Call Overhead                          15000.0     509390.6    339.6
                                                                   ========
System Benchmarks Index Score                                         606.5

------------------------------------------------------------------------
Benchmark Run: Tue Sep 27 2016 13:14:44 - 13:42:53
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables       77572329.0 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     9325.4 MWIPS (9.8 s, 7 samples)
Execl Throughput                               3223.2 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        481966.9 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          130799.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1351926.1 KBps  (30.0 s, 2 samples)
Pipe Throughput                              734678.3 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 134536.7 lps   (10.0 s, 7 samples)
Process Creation                               5801.5 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   8146.8 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1084.0 lpm   (60.1 s, 2 samples)
System Call Overhead                         901477.2 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   77572329.0   6647.2
Double-Precision Whetstone                       55.0       9325.4   1695.5
Execl Throughput                                 43.0       3223.2    749.6
File Copy 1024 bufsize 2000 maxblocks          3960.0     481966.9   1217.1
File Copy 256 bufsize 500 maxblocks            1655.0     130799.5    790.3
File Copy 4096 bufsize 8000 maxblocks          5800.0    1351926.1   2330.9
Pipe Throughput                               12440.0     734678.3    590.6
Pipe-based Context Switching                   4000.0     134536.7    336.3
Process Creation                                126.0       5801.5    460.4
Shell Scripts (1 concurrent)                     42.4       8146.8   1921.4
Shell Scripts (8 concurrent)                      6.0       1084.0   1806.7
System Call Overhead                          15000.0     901477.2    601.0
                                                                   ========
System Benchmarks Index Score                                        1113.0

------------------------------------------------------------------------
Benchmark Run: Mon Oct 03 2016 09:19:18 - 09:47:38
8 CPUs in system; running 1 parallel copy of tests
The result of the case of allocation 8 CPU and 15 GB Memory to Stretch.
Dhrystone 2 using register variables       40947340.1 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     4407.1 MWIPS (10.9 s, 7 samples)
Execl Throughput                                542.9 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        426851.1 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          113232.8 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1042961.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                              671837.6 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  43131.9 lps   (10.0 s, 7 samples)
Process Creation                               1074.5 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   4607.3 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1830.9 lpm   (60.0 s, 2 samples)
System Call Overhead                         546894.8 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   40947340.1   3508.8
Double-Precision Whetstone                       55.0       4407.1    801.3
Execl Throughput                                 43.0        542.9    126.2
File Copy 1024 bufsize 2000 maxblocks          3960.0     426851.1   1077.9
File Copy 256 bufsize 500 maxblocks            1655.0     113232.8    684.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    1042961.7   1798.2
Pipe Throughput                               12440.0     671837.6    540.1
Pipe-based Context Switching                   4000.0      43131.9    107.8
Process Creation                                126.0       1074.5     85.3
Shell Scripts (1 concurrent)                     42.4       4607.3   1086.6
Shell Scripts (8 concurrent)                      6.0       1830.9   3051.6
System Call Overhead                          15000.0     546894.8    364.6
                                                                   ========
System Benchmarks Index Score                                         613.2

------------------------------------------------------------------------
Benchmark Run: Mon Oct 03 2016 09:47:38 - 10:15:53
8 CPUs in system; running 8 parallel copies of tests

Dhrystone 2 using register variables      218684221.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                    30972.0 MWIPS (9.7 s, 7 samples)
Execl Throughput                               6237.2 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        505477.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          135568.9 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1383821.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                             4042237.9 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 564378.2 lps   (10.0 s, 7 samples)
Process Creation                               9520.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  16182.0 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   2216.4 lpm   (60.1 s, 2 samples)
System Call Overhead                        1980170.7 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0  218684221.3  18739.0
Double-Precision Whetstone                       55.0      30972.0   5631.3
Execl Throughput                                 43.0       6237.2   1450.5
File Copy 1024 bufsize 2000 maxblocks          3960.0     505477.7   1276.5
File Copy 256 bufsize 500 maxblocks            1655.0     135568.9    819.1
File Copy 4096 bufsize 8000 maxblocks          5800.0    1383821.7   2385.9
Pipe Throughput                               12440.0    4042237.9   3249.4
Pipe-based Context Switching                   4000.0     564378.2   1410.9
Process Creation                                126.0       9520.7    755.6
Shell Scripts (1 concurrent)                     42.4      16182.0   3816.5
Shell Scripts (8 concurrent)                      6.0       2216.4   3693.9
System Call Overhead                          15000.0    1980170.7   1320.1
                                                                   ========
System Benchmarks Index Score                                        2322.4

○ Reference:

1. http://blog.idcf.jp/entry/cloud/unixbench/
2. http://www.bravotouring.com/%7Eyano/diary/it/20130314unixbench.html






2016年9月1日木曜日

[iDempiere3.1] Alfresco AttachmentProvider Plugin Installation


 iDempiere3.1 has improved a lot from v2.1. Alfresco Attachment Provider Plugin is one of  the improvement, which enable to store attachment file against iDempiere records into Alfresco through CMIS. I was successful to install Alfresco Attachment Provider Plugin by the following steps.

○ Environment:

[iDempiere]
Version: 3.1
Java : openjdk version "1.8.0_102"
         OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-2-b14)
         OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
OS: Jessie(Debian) AMD-64

[Alfresco]
Version: Build 21605 (Alfresco Platform: 5.1.g, Alfresco Share 5.1.f)
Java: java version "1.7.0_111"
        OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-1~deb8u1)
        OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)
OS: Stretch (Debian) AMD-64

2 OSs run on a hypervisor, Citrix  XenServer 6.5.

○Custom Model definition

 Before using this plugin, Custom Model definition must be installed into Alfresco. To install Custom Model definition, XML files must be put into tomcat/shared/classes/alfresco/extension in Alfresco Home directory. But I needed to edit the XML files to make it work.After correcting the XML files like the followings, I just put them into tomcat/shared/classes/alfresco/extension and restart Alfresco.

[iDModel-model-context.xml]  (File name must be *-context.xml, or it cannot be loaded by Spring Framework.)
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 
 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
  <!-- Registration of new models -->
  <bean id="idempiere.dictionaryBootstrap" 
           parent="dictionaryModelBootstrap" 
           depends-on="dictionaryBootstrap">
      <property name="models">
              <list>
                <value>alfresco/extension/iDModel.xml</value>
            </list>
        </property>
    </bean>
</beans>
[iDModel.xml]
<?xml version="1.0" encoding="UTF-8"?>
<!-- iDempiere Content Model -->
<model name="id:contentmodel"
 xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!-- Optional meta-data about the model -->
   <description>iDempiere Content Model</description>
   <author>kittiu / a42niem</author>
   <version>1.0</version>

   <!-- Imports are required to allow references 
              to definitions in other models -->
   <imports>
          <!-- Import Alfresco Dictionary Definitions -->
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!-- Import Alfresco Content Domain Model Definitions -->
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!-- Introduction of new namespaces defined by this model -->
   <!-- NOTE: The following namespace my.new.model should be changed 
              to reflect your own namespace -->
   <namespaces>
      <namespace uri="idempiere.model" prefix="id"/>
   </namespaces>

   <types>

      <!-- Definition of new Content Type: 
                                 Standard Operating Procedure -->
      <type name="id:attachment">
         <title>iDempiere Attachment</title>
         <parent>cm:content</parent>
         <properties>
            <property name="id:tablename">
               <title>Table Name</title>
               <type>d:text</type> (corrected d:datetime -> d:text)
               <default></default>
            </property>
            <property name="id:recordid">
               <title>Record ID</title>
               <type>d:text</type>
               <default></default>
            </property>
            <property name="id:checksum">
               <title>Checksum</title>
               <type>d:text</type>
               <default></default>
            </property>
         </properties>
       </type>
    </types>

</model>
 I used OpenCMIS Workbench to confirm that new Custom Model are reflected after restarting Alfresco.

1. Connect to "http://server:port/alfresco/api/-default-/public/cmis/versions/1.0/atom"  by admin.
2.  Open "Types" view.
 

 

○iDempiere Storage Provider configuration

1. Login iDempiere as SuperUser and create a new Storage Provider record.


2. Login as ClientAdmin And set the created Storage Provider as storage provider in Client Info tab.

3.  Try on attach the file into any record in iDempiere. Attache files would be stored in iDempiere defined as Storage Provider.

○Alfresco Rule definition

By configuration above only, attached files were stored into Alfresco successfully, but all files are stored into a folder, it must be inconvinient. Alfresco Rule can resolve this problem by moving the files into separated folders depending on table name and record ID.

1. Download the script file prepared. I modified the file as the following for my purpose.
var tablename = tablename = document.properties["id:tablename"];
var recordid = recordid = document.properties["id:recordid"];
var subfolder1 = "";
var subfolder2 = "";
// check 
if (tablename != null)
{
  subfolder0 = space.childByNamePath('documentLibrary');
  if ( subfolder0 == null)
  {
  // Create first leve0 folder (documentLibrary)
   subfolder0 = space.createFolder('documentLibrary');
  }
  subfolder1 = subfolder0.childByNamePath(tablename);
  if ( subfolder1 == null)
  {
  // Create first level folder (tablename)
   subfolder1 = subfolder0.createFolder(tablename);
  }
  // Move itself to new folder
  document.move(subfolder1);
  // Create second level folder (recordid)
  subfolder2 = subfolder1.childByNamePath(recordid); 
  if ( subfolder2 == null)
  {
     subfolder2 = subfolder1.createFolder(recordid);
  }
  // Move itself to new folder
  document.move(subfolder2);
2. Login as admin in Alfresco and upload the script file into Dictionary/Scripts repository from Browser.


2. Set the script as Rule to the target Folder in Alfresco.


3.  When a new file is attached, Table Name folder and Record ID folder are created by Rule script.


○ Problem:

 I notices that the stored files in Alfresco from iDempiere were not indexed. So, they could not be serched by meta data and full-text search. Custom Model should've had index definition..

 

○ Reference:

1. http://wiki.idempiere.org/en/Plugin:_Alfresco_AttachmentProvider






2016年8月9日火曜日

[XenServer 6.5] Monittoring average CPU frequency


 I was successful to monitor average CPU frequency on XenServer 6.5 by Zabbix 2.2 by followings, although "cpu MHz" in /proc/cpuinfo cannot monitor real-time CPU frequency unlike other Linux distributions..

○ Environment:


CPU : AMD FX-9590 (4.7 GHz)
Mother board : ASRock 990Fx Extream 9
Phisycal Memory : 8G x 2
HDD : Western Digital WD2002FAEX x 2  (RAID 1 by mdadm)
Hypervisor : Citrix  XenServer 6.5

○xenpm command


1.xenpm start command starts measuring CPU frequency and status,  when the CTLR-C is pressed the result of the term from command execution to CTLR-C  will be shown on the console.
[root@servername ~]# xenpm start
Start sampling, waiting for CTRL-C or SIGINT or SIGALARM signal ...
(#Press CTRL-C.)
CPU0:   Residency(ms)           Avg Res(ms)
  C0    22078   (14.05%)        0.07
  C1    103813  (66.08%)        0.37
  C2    31201   (19.86%)        2.33

  P0    1539    ( 7.72%)
  P1    216     ( 1.09%)
  P2    322     ( 1.62%)
  P3    872     ( 4.38%)
  P4    319     ( 1.60%)
  P5    16670   (83.60%)
  Avg freq      1739000 KHz

CPU1:   Residency(ms)           Avg Res(ms)
  C0    22118   (14.08%)        0.07
  C1    103991  (66.20%)        0.37
  C2    30983   (19.72%)        2.36

  P0    1668    ( 8.22%)
  P1    242     ( 1.19%)
  P2    253     ( 1.25%)
  P3    844     ( 4.16%)
  P4    329     ( 1.62%)
  P5    16951   (83.55%)
  Avg freq      1786000 KHz

CPU2:   Residency(ms)           Avg Res(ms)
  C0    21972   (13.99%)        0.07
  C1    105369  (67.07%)        0.36
  C2    29752   (18.94%)        2.36

  P0    1410    ( 7.03%)
  P1    238     ( 1.19%)
  P2    296     ( 1.48%)
  P3    824     ( 4.11%)
  P4    288     ( 1.44%)
  P5    17009   (84.76%)
  Avg freq      1739000 KHz

CPU3:   Residency(ms)           Avg Res(ms)
  C0    22239   (14.16%)        0.07
  C1    105942  (67.44%)        0.36
  C2    28912   (18.40%)        2.38

  P0    1459    ( 7.17%)
  P1    287     ( 1.41%)
  P2    293     ( 1.44%)
  P3    894     ( 4.40%)
  P4    298     ( 1.47%)
  P5    17122   (84.11%)
  Avg freq      1786000 KHz

CPU4:   Residency(ms)           Avg Res(ms)
  C0    21750   (13.85%)        0.07
  C1    102451  (65.22%)        0.37
  C2    32891   (20.94%)        2.45

  P0    1401    ( 7.03%)
  P1    207     ( 1.04%)
  P2    242     ( 1.22%)
  P3    965     ( 4.85%)
  P4    289     ( 1.45%)
  P5    16817   (84.41%)
  Avg freq      1739000 KHz

CPU5:   Residency(ms)           Avg Res(ms)
  C0    21613   (13.76%)        0.07
  C1    103763  (66.05%)        0.37
  C2    31715   (20.19%)        2.38

  P0    1391    ( 7.03%)
  P1    229     ( 1.16%)
  P2    287     ( 1.45%)
  P3    1013    ( 5.12%)
  P4    295     ( 1.49%)
  P5    16571   (83.74%)
  Avg freq      1786000 KHz

CPU6:   Residency(ms)           Avg Res(ms)
  C0    22060   (14.04%)        0.07
  C1    104338  (66.42%)        0.36
  C2    30694   (19.54%)        2.43

  P0    1426    ( 7.06%)
  P1    145     ( 0.72%)
  P2    302     ( 1.50%)
  P3    921     ( 4.56%)
  P4    307     ( 1.52%)
  P5    17094   (84.64%)
  Avg freq      1739000 KHz

CPU7:   Residency(ms)           Avg Res(ms)
  C0    21691   (13.81%)        0.07
  C1    105650  (67.25%)        0.37
  C2    29751   (18.94%)        2.37

  P0    1332    ( 6.71%)
  P1    217     ( 1.09%)
  P2    314     ( 1.58%)
  P3    999     ( 5.03%)
  P4    255     ( 1.29%)
  P5    16741   (84.30%)
  Avg freq      1786000 KHz

Socket 0
         Core 0 CPU 0
         Core 1 CPU 1
         Core 2 CPU 2
         Core 3 CPU 3
         Core 4 CPU 4
         Core 5 CPU 5
         Core 6 CPU 6
         Core 7 CPU 7

 If the argument for timeout(sec.) is given to xenpm command like the below, the user don't need to press CTRL-C to show the results.
[root@servername ~]# xenpm start 10

○ Setting Zabbix 2.2 Agent on XenServer 6.5

1. Set the sudo configuration on XenServer .5 so that zabbix user can execute xenpm command.Add the following to /etc/sudoers if zabbix user is added to wheel group on XenServer 6.5.
 %wheel  ALL=(ALL)       NOPASSWD:       /usr/sbin/xenpm

2.  Set Timeout parameter in /etc/zabbix/zabbix_server.conf on Zabbix Server. Add the following to conf file.(Default = 3).
Timeout=30

3. Set Timeout parameter in /etc/zabbix/zabbix_agentd.conf on XenServer 6.5. Add the following to conf file.(Default = 3)
Timeout=30

4. Add the followings to /etc/zabbix/zabbix-agentd.conf on XenServer 6.5 to report .
 UserParameter=xenpm_start[*],sudo xenpm start 10|grep $2|sed -n -e $1"p"|awk '{print $$3}'
5. Restart Zabbix server and agent on XenServer 6.5 in order to reflect configuration changes.
  [root@servername ~]# /etc/init.d/zabbix-agent restart
  [root@servername2 ~]# /etc/init.d/zabbix-server restart
6. Add a new Item for average CPU frequency.of XenServer 6.5 on Zabbix Server


7. You can get the following result after creating the graph.


○ Reference:

1. http://wiki.xenproject.org/wiki/Xenpm_command






2016年8月1日月曜日

[XenServer 6.5] CPU Temperature Monitoring by Zabbix 2.2


 I was successful to monitor CPU temp. on XenServer 6.5 by Zabbix 2.2 by followings.

○ Environment:


CPU : AMD FX-9590 (4.7 GHz)
Mother board : ASRock 990Fx Extream 9
Phisycal Memory : 8G x 2
HDD : Western Digital WD2002FAEX x 2  (RAID 1 by mdadm)
Hypervisor : Citrix  XenServer 6.5

○ Install lm_sensors package


1.Download lm_sensors binary file from the below link
ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archive.fedoraproject.org/fedora/linux/releases/10/Fedora/x86_64/os/Packages/lm_sensors-3.0.2-1.fc10.x86_64.rpm 
2. Install the lm_sensors by rmp command.
[root@servername ~]# rpm -ivh lm_sensors-3.0.2-1.fc10.x86_64.rpm
3. Configure lm_sensors.
[root@servername ~]# sensors-detect
(#Answer "Y" to all questions.)
[root@servername ~]# modprobe  -v k10temp     (#Load driver)
[root@servername ~]# modprobe -v w83627ehf     (#Load driver)
[root@xenserver-ixyaeoht ~]# modprobe -v w83627ehf
insmod /lib/modules/3.10.0+2/kernel/drivers/hwmon/hwmon-vid.ko
insmod /lib/modules/3.10.0+2/kernel/drivers/hwmon/w83627ehf.ko
[root@servername ~]# sernsors
k10temp-pci-00c3
Adapter: PCI adapter
temp1:       +21.6°C  (high = +70.0°C, crit = +70.0°C)

nct6776-isa-0290
Adapter: ISA adapter
in0:         +0.89 V  (min =  +0.00 V, max =  +1.74 V)
in1:         +1.85 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in2:         +3.25 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in3:         +3.25 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in4:         +1.48 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in5:         +1.69 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in7:         +3.46 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
in8:         +3.36 V  (min =  +0.00 V, max =  +0.00 V)   ALARM
fan1:          0 RPM  (min =    0 RPM)  ALARM
fan2:          0 RPM  (min =    0 RPM)  ALARM
fan3:          0 RPM  (min =    0 RPM)  ALARM
fan4:          0 RPM  (min =    0 RPM)  ALARM
fan5:          0 RPM  (min =    0 RPM)  ALARM
SYSTIN:      +33.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:      +36.5°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN:       +2.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
cpu0_vid:   +1.550 V
[root@servername ~]# sernsors -u
 k10temp-pci-00c3
Adapter: PCI adapter
temp1:
  temp1_input: 28.25
  temp1_max: 70.00
  temp1_crit: 70.00
  temp1_crit_hyst: 67.00

nct6776-isa-0290
Adapter: ISA adapter
in0:
  in0_input: 1.50
  in0_min: 0.00
  in0_max: 1.74
  in0_alarm: 0.00
in1:
  in1_input: 1.85
  in1_min: 0.00
  in1_max: 0.00
  in1_alarm: 1.00
in2:
  in2_input: 3.25
  in2_min: 0.00
  in2_max: 0.00
  in2_alarm: 1.00
in3:
  in3_input: 3.25
  in3_min: 0.00
  in3_max: 0.00
  in3_alarm: 1.00
in4:
  in4_input: 1.47
  in4_min: 0.00
  in4_max: 0.00
  in4_alarm: 1.00
in5:
  in5_input: 1.69
  in5_min: 0.00
  in5_max: 0.00
  in5_alarm: 1.00
in7:
  in7_input: 3.46
  in7_min: 0.00
  in7_max: 0.00
  in7_alarm: 1.00
in8:
  in8_input: 3.36
  in8_min: 0.00
  in8_max: 0.00
  in8_alarm: 1.00
fan1:
  fan1_input: 0.00
  fan1_min: 0.00
  fan1_alarm: 1.00
fan2:
  fan2_input: 0.00
  fan2_min: 0.00
  fan2_alarm: 1.00
fan3:
  fan3_input: 0.00
  fan3_min: 0.00
  fan3_alarm: 1.00
fan4:
  fan4_input: 0.00
  fan4_min: 0.00
  fan4_alarm: 1.00
fan5:
  fan5_input: 0.00
  fan5_min: 0.00
  fan5_alarm: 1.00
SYSTIN:
  temp1_input: 33.00
  temp1_max: 0.00
  temp1_max_hyst: 0.00
  temp1_alarm: 1.00
  temp1_type: 4.00
  temp1_offset: 0.00
CPUTIN:
  temp2_input: 36.00
  temp2_max: 80.00
  temp2_max_hyst: 75.00
  temp2_alarm: 0.00
  temp2_type: 4.00
  temp2_offset: 0.00
AUXTIN:
  temp3_input: 2.50
  temp3_max: 80.00
  temp3_max_hyst: 75.00
  temp3_alarm: 0.00
  temp3_type: 4.00
  temp3_offset: 0.00
cpu0_vid:
  cpu0_vid: 1.55
    I need only CPU temp. , so I don't care that fan speed can't be obtained.

○ Setting Zabbix 2.2 Agent on XenServer 6.5

1. Add the followings to /etc/zabbix/zabbix-agentd.conf on XenServer 6.5 to report .
 UserParameter=lm_sensors[*],sensors -u $1|grep $2|cut -d ":" -f2|cut -d " " -f2
2. Restart Zabbix agent on XenServer 6.5
  [root@servername ~]# /etc/init.d/zabbix-agent restart
3. Add a new Item for CPU temp.of XenServer 6.5 on Zabbix Server


4. You can get the following result after creating the graph.


○ Reference:

1. http://hidenosuke.org/diary/?date=20130429
2. http://blog.goo.ne.jp/shigen417/e/0207cc853b4a8a173fe4baa116bc14bf






2015年5月15日金曜日

STAP Cell fabrication

 いまさらの話題で恐縮ですが、小保方さんの事件について思うところを書いておきます。

 この事件は、もう既に、いろんな人がいろんなコメントをつけた後で、ぺんぺん草も生えてない状況ですが、まだあまり語られてない側面があるように思えてなりません。多くのコメントでは、事件当初のマスコミの取り上げ方だったり、理研の事件への対応(不手際)だったり、小保方さん本人のキャラであったりといった観点で語られることが多いと思います。

 もっと重要なのは、研究者の小さい世界にとどまらず、今現在”日本で”幅広く起こっている現象がこの事件に顕著に現れているという観点ではないでしょうか。そういった視点で語られものもあるにはあるですが、多くは「最近の若手研究者は、厳しい競争にさらされていて。。。(以下略)」といったものが大半で、競争や成果主義の否定へもっていく結論ありきの議論に帰結してしまっているよに見えます。

 研究者だけでなく仕事における成果の評価って、人間が社会で生きる上でとても重要な問題であると、最近つくづく思っています。人間関係が大事といいつつ、今の社会では、人間関係と正当な成果の評価って二律背反の概念になってしまっているように思います。具体的にいえば、自分に自信がない人が「上司(先生)にぺこぺこしてれば、生きていくことを無条件に許される。」なんてことを真剣に考えて、そんなことを考える人が多数になってしまったら、その社会はどうなるでしょうか?ってことを考えてみて思ったことですが、

1. 能力のない自信のない一部の人がペコペコをはじめる。
2. 能力がある人がはじかれるのと裏腹に、実際にその一部の人が生き残るのを、周りの人が認識し始める。
3. 他の人たちもペコペコをはじめる。
4. ペコペコを大多数が始めたら、自信の能力や成果による集団内の評価は意味をなさず、むしろペコペコしてないというマイナス評価になる。
5. 集団が没落する。

小保方さんの事件から見出せるのは、上のプロセスの4番目の現象が少なくとも理研の中、小保方さんの周囲では起こっていたのではないかという懸念です。だから、あんな杜撰な内部評価で大変な問題を引き起こしてしまったのではないでしょうか?

 マスコミの伝え方に対する違和感や、まだ語れてないことがあるのではと感じる原因はここにあると思います。多くのコメントは、どこか遠くの特別な理研内部で起こった特別な問題であるかのように思っている、あるいは思いたい、とか思わせようとしていると印象を受けます。雑誌に論文を投稿するのは、理研の人だけではないですし、東大で同時期に発覚した大規模な論文不正もありました。民間の人だって論文は投稿するし、不正だって数知れず発生してます。自分も目の当たりしてきました。自分が見た民間のケースでは、明らかに上に書いた集団の没落プロセスが進行するのと平行して不正も発生していたし、周囲の見過ごしも発生してました。この事件を多くの人が、自分と社会を取り巻く現在進行形の問題として認識することが大切なのではないかと思っています。明らかに、小保方さんの事件をおこしたのは自分だという自覚が一人ひとりに必要なのです。社会人にも学生にとっても。理研のせいにしたり、官邸陰謀論を持ち出せば済む問題ではありません。

 また、同様のマスコミの報道姿勢は、佐村河内さんの事件でも見受けられました。そちらで受けた同様の違和感は、マスコミの主張する「ちゃんと契約をしていればゴーストライターでも問題ない」という主張です。多分、多くの人は自分自身で出した成果でないのに自分でやったということ自体が社会の評価のプロセスを歪めるという点で害をなすと考えると思うのですが、マスコミの中にゴーストライターが必要悪として存在しているという現実が、マスコミ自身をこの事件を自分にひきつけて考えることを阻害してしまっているのかと思います。

マスコミ特にテレビ自身も没落のプロセスに随分前から入ってしまっていたのかなと、この2つの事件を通して改めておもいました。