Category Archives: Error

[Solved] redis Error: Can‘t save in background fork Cannot allocate memory

redis-cli -p 12345

[root@localhost ~]# redis-cli -p 6379
127.0.0.1:6379> auth "123456"
OK
127.0.0.1:6379> info
# Server
redis_version:3.2.12
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:7897e7d0e13773f
redis_mode:standalone
os:Linux 3.10.0-1127.19.1.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.8.5
process_id:1242
run_id:XXX
tcp_port:6379
uptime_in_seconds:1186639
uptime_in_days:13
hz:10
lru_clock:11977524
executable:/usr/bin/redis-server
config_file:/etc/redis.conf

# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:3486652368
used_memory_human:3.25G
used_memory_rss:3548164096
used_memory_rss_human:3.30G
used_memory_peak:3486886808
used_memory_peak_human:3.25G
total_system_memory:16637546496
total_system_memory_human:15.49G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:1.02
mem_allocator:jemalloc-3.6.0

# Persistence
loading:0
rdb_changes_since_last_save:8
rdb_bgsave_in_progress:0
rdb_last_save_time:1639367433
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:20
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok

# Stats
total_connections_received:3831251
total_commands_processed:18072447
instantaneous_ops_per_sec:15
total_net_input_bytes:1538227697
total_net_output_bytes:907587826299
instantaneous_input_kbps:0.61
instantaneous_output_kbps:3.07
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
evicted_keys:0
keyspace_hits:7332354
keyspace_misses:6533
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:2025
migrate_cached_sockets:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:1586.86
used_cpu_user:625.00
used_cpu_sys_children:3198.40
used_cpu_user_children:46091.06

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=936,expires=0,avg_ttl=0

 

 

redis maxmemory:0 There is no limit to the amount of memory that can be used.
linux
[root@localhost redis]# sysctl -a|grep overcommit_memory
vm.overcommit_memory = 0
vm.overcommit_memory = 0 Heuristic The size of the virtual memory allocated for this request and the current free physical memory on the system plus swap determine whether to release it. When the system allocates virtual address space for the application process, it determines whether the size of the currently requested virtual address space exceeds the remaining memory size, and if it does, the virtual address space allocation fails.
When redis saves in-memory data to disk, in order to prevent the main process from falsely dying, it forks a child process to complete this save operation. However, the forked subprocess will need to allocate the same amount of memory as the main process, which is equivalent to double the amount of memory needed, and if there is not enough memory available to allocate the required memory, the forked subprocess will fail to save the data to disk.
/etc/redis.conf
[root@localhost etc]# more redis.conf |grep “stop-writes-on-bgsave-error”
stop-writes-on-bgsave-error yes
stop-writes-on-bgsave-error: Whether to continue processing Redis write commands when generating RDB files with errors, the default yes Redis does not allow users to perform any update operations
Reasons.
1 The memory of redis itself is not limited. maxmemory:0.
2 redis forks the same memory as the main process when it forks the process to save data, which is memory double.
3 linux server vm.overcommit_memory = 0, which does not allow excessive memory overcommits.
4 redis configuration file default stop-writes-on-bgsave-error, which does not allow users to exceed when writes fail.
Optimization suggestions.
Modify vm.overcommit_memory = 0 vm.overcommit_memory = 1

 

[Solved] QT error: the packaged exe of Enigma virtual box reports an error cannot load library qt5core.dll

Question:

Put the enigma virtual box packaged exe to another computer for use, and an error will be reported when opening the EXE: cannot load library qt5core DLL
(in fact, the library qt5core.DLL is included when using enigma virtual box)

reason:

This is not the lack of qt5core DLL , nor is there a problem with this library. Because [problem solving] the code cannot be executed because libgcc_s_dw2-1.dll, libwinpthread.dll and libstdc + ± 6.dll cannot be found. Reinstallation may solve this problem. This problem is caused by the lack of libgcc_s_dw2-1.DLL, libwinpthread.DLL, libstdc + + - 6.dll , but the error cannot be reported after packaging load library Qt5Core.DLL, the analysis may be because qt5core DLL depends on the above libraries to run.

 

Solution:

From Qt5 12.0\5.12.0\mingw73_64\bin (different versions and different directories) copy the three dynamic libraries libgcc_s_dw2-1.DLL, libwinpthread.DLL, libstdc + + - 6.DLL , and then use the EXE packaged with enigma virtual box to avoid errors.

comparison of directories before and after modification:

[Solved] kettle Error: GC overhead limit exceeded

An error is reported when running a kettle script online

 java.lang.OutOfMemoryError: GC overhead limit exceeded 

The reason is that the memory settings of the local test are different from the online memory settings, and the memory size configured on the offline can be modified.

Spoon. The memory set in bat (windows side) and spoon.sh (Linux side) is too small. It can be set to 1/4 of the machine memory, such as 16g memory, which can be set to 4G.

– XMS initial heap size.
– Xmx maximum heap size.

In many cases, – XMS and – Xmx are set to the same. This setting is because when heap is not enough, memory jitter will occur, affecting the stability of program operation.

[Solved] PYNQ load bit error: KeyError: ‘interrupts‘

Problem Description:

In the BD diagram of vivado, the interrupted direct connection between my IP and PS Core

An error occurs when loading the bit file generated by vivado in pynq

Solution:

Add a concat block in the connection between PS and our own IP interrupt line, as shown in the figure below

finally, the bit file can be successfully loaded in pynq

and the final program can output correct results

[Solved] jedis Connect redis Error: connect timed out

1. First check whether we are in redis.Conf or not and enter redis.conf if not.

(1) Find bind 127.0.0.1 under network and comment out this line.

(2) Find protected mode yes under network and change yes to No.

2. If this modification has not been solved, check the firewall.

systemctl status firewalld

If it’s like this, we can turn off the firewall

systemctl stop firewalld

Then we’ll test it again

After running, Pong solves the problem.

[Solved] JMETER pressure measure with a lot of Ports Error: 504GATEWAY TIMEOUT

1. First check the test environment

2. Check the test script for problems, such as the failure of the previous request and the error caused by the subsequent request

3. Niginx work_Connection configuration

4. Due to system limits open files restrictions

One. When the number of threads under pressure test is too large, or the threads are not released in time, the open TCP/IP connection port of the system has reached the maximum limit, and JMeter will directly report an error
[error message]: java.net.bindexception: address ready in use.
[cause analysis]: Windows provides 1024-5000 ports for TCPIP connection, and it takes about four minutes to recycle, which leads to that when we frequently call a large number of requests in a short time, the port will be full.
[solution]:

1. Open the registry: CMD (Win + R) enter regedit to open the registry;
2. Set the system parameter: the maximum number of port connections.
① find the system parameter setting item: \hkey_local_machine\system\currentcontrolset\services\TCPIP\parameters
② right click parameters to add a new DWORD with the parameter name maxuserport;
③ double click maxmaxuserport, and the entered value is 65534 Select decimal
④ restart the computer! Restart the computer! Restart the computer
2. Socket closed
[cause analysis]: the number of threads has reached the bottleneck.
[solution]

1. When creating a thread in a loop, check keep alive to reuse the thread
2. Expand the thread pool size of the program under test. (when the program has a bottleneck)
III. insufficient memory
[exception]: a large number of. Hprof files are generated in the JMeter installation directory.
[cause analysis]: the generation of such. Hprof files is caused by memory leakage.
[solution]:

1. Upgrade the hardware configuration of JMeter pressure measuring machine to increase memory space
2. Modify the system parameters of JMeter
① open JMeter Bat file
② modify the memory usage size of JMeter pressure tester:
set heap = – xms3g – xmx3g – XX: maxmetaspacesize = 768m (1g by default, modified to 3G)
3. Detect the tested program and find out whether there is memory leakage in the tested software program.
IV. bandwidth bottleneck
[phenomenon]: a large number of request timeouts occur in JMeter execution results, but the server of the tested program does not have error protection log.
[analysis]: it may be that the bandwidth of the master computer has reached the bottleneck.
[solution]:

1. Upgrade the hardware configuration of the main control computer and expand the bandwidth value, such as from 100MB → 500MB
2. Divide multiple main controllers equally to avoid too many remote actuators of a single main controller. It is best to control within 10
distributed testing has some basic limitations. The following items are mentioned in the official documents:

1. RMI cannot communicate across subnets without an agent; Therefore, during distributed pressure measurement, all actuators of JMeter should be placed in the same network segment
2. Starting from version 2.9, JMeter sends all test results of stripping response data to the console, which can reduce the impact on network io. Ensure that network traffic is monitored to avoid traffic contention
3. When a single JMeter client runs on a host with a 2-3 GHz CPU, it can process 1000-2000 threads, depending on the type of test
(this also depends on the complexity of the business process. If a long connection is involved in the business process, the measured single JMeter client can only better support 800-1000 threads)
VI. it is recommended to
restart the piezoelectric machine regularly, and it is best to restart the computer before each pressure test.
regularly clean the log file generated by JMeter: jmeter.log & jmeter-server.log (under the installation directory).
during distributed deployment, it is better for one master computer to control only less than 10 executors to avoid the bottleneck of bandwidth and memory of the master computer.
during pressure measurement, it is necessary to monitor the resource usage of CPU, memory, network and IO of the lower pressure measurement machine.

How to Solve Vscode terminal error (ts -v)

Solution: (test available)
run PowerShell as an administrator and execute the command set-ExecutionPolicy RemoteSigned to change the execution policy of PowerShell to RemoteSigned

1. Win + X: select windows PowerShell to open the shell
2. Run set-ExecutionPolicy RemoteSigned command and enter y
3. Run get-ExecutionPolicy command to see that the execution policy of the script has been changed to RemoteSigned
4. Return to the vscode terminal and enter the command TSC – V to stop reporting errors, TS files can also be compiled

[Solved] NPM run build package error: Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory

1. Phenomenon

It has always been normal. Suddenly one day, an error is reported when packing. The key information is as follows:
ineffective mark compacts near heap limit allocation failed - Javascript heap out of memory
the details are as follows:

2. Solution

All kinds of data say that node memory overflow , and solutions are also given,
for example: – max_old_space_Size = 4096 and so on, but it doesn’t work for me. (if you refer to mine, it doesn’t work, you can look at the other methods mentioned above)
later, I saw a solution, which worked
1, CMD Global install increase memory limit
NPM install -g increase memory limit

2, CD enter the project directory and execute:
increase memory limit

3. Repack
NPM run build

NUXT Run generate error: is not in cwd [How to Solve]

Record errors every day

Recently, I took over a nuxtjs project, which was the secondary development bought by the company. I had a little side dishes and played a little foolishly, but it was solved.

When the project was to be delivered online two days ago, I found that I reported an error when running NPM run generate to package, but running build and dev were normal. The whole face was confused. I didn’t find a similar problem in Baidu for a long time. Then I had to go to the official problem of GitHub. It was all English, which made me feel numb. Finally, I really found that when generating applications, I will jump into the virtual Linux machine to obtain dist, that is, this problem may occur in the windows system, and then the Linux system obtains the path. Different from windows, it needs to standardize the path. The error is in the node_modules@nuxt\cli\dist\cli-generate.js

export async function snapshot ({ globbyOptions, ignore, rootDir }) {
  const snapshot = {}

  const files = await globby('**/*.*', {
    ...globbyOptions,
    ignore,
    cwd: rootDir,
    absolute: true
  })

Change cwd :rootDir to cwd : upath . normalize ( rootDir ).

const  files  =  await  globby__default [ 'default' ] ( '**/*.*' ,  { 
    ... globbyOptions , 
    ignore , 
    cwd : upath . normalize ( rootDir ) , 
    absolute : true 
  } ) ;