Cache_fu插件使用方法

本文探讨了在Rails应用中使用Memcache进行高效缓存的方法。介绍了多种缓存技术,包括片段缓存、动作缓存及缓存模型等,并详细讲解了cache_fu插件的应用。同时分享了缓存管理技巧,如缓存重写和版本控制。

 

Chris 曾经在Gamespot工作,他在这里谈论游戏。在过去的一年党中,有无数的年轻人在不停地刷新这个网站,而此网站依然坚挺。他们每天要处理50M地页面,没有down掉。他们用Memcache做到了这点。

Memcache 是个分布式的hash,由Livejournal开发。

你会选择用Memcache吗?

Rails and Memcache

用Fragments, Actions, Sessions, Objects缓存, 你可以使用:

memcache-client (by Robot-coop guys/Eric Hodel). Marshal.unload is 40 times faster than Object.new/loading from the database. CachedModel – integration with ActiveRecord Fragment Cache Store Memcache session store

…或者…

cache_fu插件

或者叫 acts_as_cached 2.0。它覆盖以上讨论的所有Objects,只需要配置一个YAML 文件(config/memcached.yml).提醒:不要在服务器配置文件中使用names.而是要用IPs,为了避免BIND和每次连接都连接数据库.

get_cache expire_cache

你需要的只有这些--你过你用set_cache,你可能不清楚改插件是如何工作的。要在在after save钩子上使用缓存失效机制。例如:

class 



Presentation



 <

 ActiveRecord

::

Base


  acts_as_cached


  after_save

 :expire_cache


end






再如:

class Presentation < ActiveRecord :: Base
  acts_as_cached :conditions => ' published = 1 '
end

Cached-scoped-finders (译者注:不知如何翻译).。这个用法将会把自定义地find方法挪到model上,然后在其中包装一些缓存机制,cache_fu插件通过AR::Base方法将这个功能有机结合起来。

class 



Topic



 <

 ActiveRecord

::

Base


  def 

self.weekly_popular


    Topic

.

find

 :all

,

 ...


  end


end



Topic

.

cached

(

:weekly_popular

)






alias_method_chain方法将date加入到缓存键:

def 



self.cache_key_with_date



(



id



)




  ...


end



class 

<<

 self


  alias_method_chain

 :cache_key

,

 :date


end






用ID加载缓存:由Topic.find(1, 2, 3)转变为Topic.get_cache(1, 2, 3),这样可以将缓存数据放入memcached,并且在以后访问他们。

user_ids



 =

 @topic

.

posts

.

map

(&

:user_id

).

uniq


@users

 =

 User

.

get_cache

(

user_ids

)






你也可以缓存关联,因此,你可以通过memcache来导航关联。

缓存重写

class 



ApplicationController



 <

 ActionController

::

Base


  before_filter

 :set_cache_override


  def 

set_cache_override


    ActsAsCached

.

skip_cache_gets

 =

 !!

params

[

:skip_cache

]


  end


end






reset_cache:重置缓存(这段不知道改怎么翻译了:reset_cache : Slow, uncached operations can sometimes queue up and wedge a site. Instead, issue cache resets on completion of a request, rather than expiring beforehand. That way, requests that continue to pile up will still use the cached copy until the rebuild is complete.)

class 



Presentation



 <

 ActiveRecord

::

Base


  after_save

 :reset_cache


end






版本:当修改代码后地缓存方式

class 



Presentation



 <

 ActiveRecord

::

Base


  acts_as_cached

 :version

 =>

 1


end






部署:Chris推键是一能够Monit部署以保证Memcache服务器高效率工作。(译者注:不知其他服务器效率如何)

livketama:在不使缓存实效地情况下重新部署Memcache服务器。

问题: Page caching? Nginx 会使用本地Memcache page caching,即在rails 主机之外。

后记:由于本人最近正在研究cache_fu插件地使用方法,本篇文章会持续更新,敬请关注。欢迎发表您对该插件的理解。

运行rabbitmq日志2025-07-30 08:44:54.598 [debug] <0.287.0> Lager installed handler {lager_file_backend, "d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log"} into lager_event 2025-07-30 08:44:54.598 [debug] <0.290.0> Lager installed handler error_logger_lager_h into error_logger 2025-07-30 08:44:54.608 [debug] <0.293.0> Lager installed handler lager_forwarder_backend into error_logger_lager_event 2025-07-30 08:44:54.608 [debug] <0.296.0> Lager installed handler lager_forwarder_backend into rabbit_log_lager_event 2025-07-30 08:44:54.608 [debug] <0.299.0> Lager installed handler lager_forwarder_backend into rabbit_log_channel_lager_event 2025-07-30 08:44:54.608 [debug] <0.302.0> Lager installed handler lager_forwarder_backend into rabbit_log_connection_lager_event 2025-07-30 08:44:54.608 [debug] <0.305.0> Lager installed handler lager_forwarder_backend into rabbit_log_feature_flags_lager_event 2025-07-30 08:44:54.608 [debug] <0.308.0> Lager installed handler lager_forwarder_backend into rabbit_log_federation_lager_event 2025-07-30 08:44:54.608 [debug] <0.311.0> Lager installed handler lager_forwarder_backend into rabbit_log_ldap_lager_event 2025-07-30 08:44:54.608 [debug] <0.317.0> Lager installed handler lager_forwarder_backend into rabbit_log_prelaunch_lager_event 2025-07-30 08:44:54.608 [debug] <0.314.0> Lager installed handler lager_forwarder_backend into rabbit_log_mirroring_lager_event 2025-07-30 08:44:54.608 [debug] <0.320.0> Lager installed handler lager_forwarder_backend into rabbit_log_queue_lager_event 2025-07-30 08:44:54.608 [debug] <0.323.0> Lager installed handler lager_forwarder_backend into rabbit_log_ra_lager_event 2025-07-30 08:44:54.608 [debug] <0.326.0> Lager installed handler lager_forwarder_backend into rabbit_log_shovel_lager_event 2025-07-30 08:44:54.608 [debug] <0.329.0> Lager installed handler {lager_file_backend, "d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12_upgrade.log"} into rabbit_log_upgrade_lager_event 2025-07-30 08:44:54.619 [info] <0.44.0> Application lager started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:54.633 [info] <0.273.0> Log file opened with Lager 2025-07-30 08:44:54.996 [info] <0.44.0> Application mnesia started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:54.998 [info] <0.273.0> Starting RabbitMQ 3.8.8 on Erlang 23.3.4.18 Copyright (c) 2007-2020 VMware, Inc. or its affiliates. Licensed under the MPL 2.0. Website: https://rabbitmq.com 2025-07-30 08:44:54.998 [info] <0.273.0> node : rabbit@LAPTOP-FU2L4D12 home dir : C:\Users\小橙 config file(s) : (none) cookie hash : mkQxrMfpOoR5L3HCS5ZoGA== log(s) : d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log : d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12_upgrade.log database dir : d:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia 2025-07-30 08:44:55.053 [debug] <0.285.0> Lager installed handler lager_backend_throttle into lager_event 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step pre_boot defined by app rabbit 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step rabbit_core_metrics defined by app rabbit 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step rabbit_alarm defined by app rabbit 2025-07-30 08:44:59.281 [info] <0.361.0> Memory high watermark set to 6473 MiB (6787769958 bytes) of 16183 MiB (16969424896 bytes) total 2025-07-30 08:44:59.480 [info] <0.363.0> Enabling free disk space monitoring 2025-07-30 08:44:59.480 [info] <0.363.0> Disk free limit set to 50MB 2025-07-30 08:44:59.524 [info] <0.273.0> Running boot step code_server_cache defined by app rabbit 2025-07-30 08:44:59.524 [info] <0.273.0> Running boot step file_handle_cache defined by app rabbit 2025-07-30 08:44:59.524 [info] <0.366.0> Limiting to approx 65439 file handles (58893 sockets) 2025-07-30 08:44:59.524 [info] <0.367.0> FHC read buffering: OFF 2025-07-30 08:44:59.524 [info] <0.367.0> FHC write buffering: ON 2025-07-30 08:44:59.525 [info] <0.273.0> Running boot step worker_pool defined by app rabbit 2025-07-30 08:44:59.525 [info] <0.351.0> Will use 8 processes for default worker pool 2025-07-30 08:44:59.525 [info] <0.351.0> Starting worker pool 'worker_pool' with 8 processes in it 2025-07-30 08:44:59.525 [info] <0.273.0> Running boot step database defined by app rabbit 2025-07-30 08:44:59.526 [info] <0.273.0> Node database directory at d:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia is empty. Assuming we need to join an existing cluster or initialise from scratch... 2025-07-30 08:44:59.526 [info] <0.273.0> Configured peer discovery backend: rabbit_peer_discovery_classic_config 2025-07-30 08:44:59.526 [info] <0.273.0> Will try to lock with peer discovery backend rabbit_peer_discovery_classic_config 2025-07-30 08:44:59.526 [info] <0.273.0> Peer discovery backend does not support locking, falling back to randomized delay 2025-07-30 08:44:59.526 [info] <0.273.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping randomized startup delay. 2025-07-30 08:44:59.526 [info] <0.273.0> All discovered existing cluster peers: 2025-07-30 08:44:59.526 [info] <0.273.0> Discovered no peer nodes to cluster with. Some discovery backends can filter nodes out based on a readiness criteria. Enabling debug logging might help troubleshoot. 2025-07-30 08:44:59.533 [info] <0.44.0> Application mnesia exited with reason: stopped 2025-07-30 08:44:59.533 [info] <0.44.0> Application mnesia exited with reason: stopped 2025-07-30 08:44:59.553 [info] <0.44.0> Application mnesia started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.608 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.608 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.622 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.622 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.622 [info] <0.273.0> Feature flag `implicit_default_bindings`: supported, attempt to enable... 2025-07-30 08:44:59.622 [info] <0.273.0> Feature flag `implicit_default_bindings`: mark as enabled=state_changing 2025-07-30 08:44:59.626 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.626 [info] <0.273.0> Feature flags: [~] implicit_default_bindings 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] maintenance_mode_status 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.643 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 0 retries left 2025-07-30 08:44:59.643 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.643 [info] <0.273.0> Feature flag `implicit_default_bindings`: mark as enabled=true 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] maintenance_mode_status 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.661 [info] <0.273.0> Feature flag `maintenance_mode_status`: supported, attempt to enable... 2025-07-30 08:44:59.661 [info] <0.273.0> Feature flag `maintenance_mode_status`: mark as enabled=state_changing 2025-07-30 08:44:59.665 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.665 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [~] maintenance_mode_status 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.677 [info] <0.273.0> Creating table rabbit_node_maintenance_states for feature flag `maintenance_mode_status` 2025-07-30 08:44:59.680 [info] <0.273.0> Feature flag `maintenance_mode_status`: mark as enabled=true 2025-07-30 08:44:59.686 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.699 [info] <0.273.0> Feature flag `quorum_queue`: supported, attempt to enable... 2025-07-30 08:44:59.699 [info] <0.273.0> Feature flag `quorum_queue`: mark as enabled=state_changing 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [~] quorum_queue 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.718 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.718 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.718 [info] <0.273.0> Feature flag `quorum_queue`: migrating Mnesia table rabbit_queue... 2025-07-30 08:44:59.734 [info] <0.273.0> Feature flag `quorum_queue`: migrating Mnesia table rabbit_durable_queue... 2025-07-30 08:44:59.751 [info] <0.273.0> Feature flag `quorum_queue`: Mnesia tables migration done 2025-07-30 08:44:59.751 [info] <0.273.0> Feature flag `quorum_queue`: mark as enabled=true 2025-07-30 08:44:59.755 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.772 [info] <0.273.0> Feature flag `virtual_host_metadata`: supported, attempt to enable... 2025-07-30 08:44:59.772 [info] <0.273.0> Feature flag `virtual_host_metadata`: mark as enabled=state_changing 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [~] virtual_host_metadata 2025-07-30 08:44:59.776 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.786 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.786 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.807 [info] <0.273.0> Feature flag `virtual_host_metadata`: mark as enabled=true 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] virtual_host_metadata 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.823 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.824 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.842 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.842 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.842 [info] <0.273.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration. 2025-07-30 08:44:59.842 [info] <0.273.0> Running boot step database_sync defined by app rabbit 2025-07-30 08:44:59.842 [info] <0.273.0> Running boot step feature_flags defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step codec_correctness_check defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step external_infrastructure defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_registry defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_cr_demo defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_queue_location_random defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_event defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_amqplain defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_plain defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_direct defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_fanout defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_headers defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_topic defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_all defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_exactly defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_nodes defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_priority_queue defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Priority queues enabled, real BQ is rabbit_variable_queue 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_queue_location_client_local defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_queue_location_min_masters defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step kernel_ready defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_sysmon_minder defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_epmd_monitor defined by app rabbit 2025-07-30 08:44:59.845 [info] <0.605.0> epmd monitor knows us, inter-node communication (distribution) port: 25672 2025-07-30 08:44:59.845 [info] <0.273.0> Running boot step guid_generator defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step rabbit_node_monitor defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.609.0> Starting rabbit_node_monitor 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step delegate_sup defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step rabbit_memory_monitor defined by app rabbit 2025-07-30 08:44:59.849 [info] <0.273.0> Running boot step core_initialized defined by app rabbit 2025-07-30 08:44:59.849 [info] <0.273.0> Running boot step upgrade_queues defined by app rabbit 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: 1 to apply 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: Applying rabbit_variable_queue:move_messages_to_vhost_store 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: No durable queues found. Skipping message store migration 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: Removing the old message store data 2025-07-30 08:44:59.860 [info] <0.273.0> message_store upgrades: All upgrades applied successfully 2025-07-30 08:44:59.878 [info] <0.273.0> Running boot step rabbit_connection_tracking defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_connection_tracking_handler defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_exchange_parameters defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_mirror_queue_misc defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_policies defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_policy defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_queue_location_validator defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_quorum_memory_manager defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_vhost_limit defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step recovery defined by app rabbit 2025-07-30 08:44:59.881 [info] <0.273.0> Running boot step empty_db_check defined by app rabbit 2025-07-30 08:44:59.881 [info] <0.273.0> Will seed default virtual host and user... 2025-07-30 08:44:59.881 [info] <0.273.0> Adding vhost '/' (description: 'Default virtual host') 2025-07-30 08:44:59.886 [info] <0.646.0> Making sure data directory 'd:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists 2025-07-30 08:44:59.889 [info] <0.646.0> Starting message stores for vhost '/' 2025-07-30 08:44:59.889 [info] <0.650.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index 2025-07-30 08:44:59.891 [info] <0.646.0> Started message store of type transient for vhost '/' 2025-07-30 08:44:59.891 [info] <0.654.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index 2025-07-30 08:44:59.892 [warning] <0.654.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch 2025-07-30 08:44:59.893 [info] <0.646.0> Started message store of type persistent for vhost '/' 2025-07-30 08:44:59.896 [info] <0.273.0> Created user 'guest' 2025-07-30 08:44:59.896 [info] <0.273.0> Successfully set user tags for user 'guest' to [administrator] 2025-07-30 08:44:59.897 [info] <0.273.0> Successfully set permissions for 'guest' in virtual host '/' to '.*', '.*', '.*' 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step rabbit_looking_glass defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step rabbit_core_metrics_gc defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step background_gc defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step connection_tracking defined by app rabbit 2025-07-30 08:44:59.900 [info] <0.273.0> Setting up a table for connection tracking on this node: 'tracked_connection_on_node_rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.902 [info] <0.273.0> Setting up a table for per-vhost connection counting on this node: 'tracked_connection_per_vhost_on_node_rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step routing_ready defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step pre_flight defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step notify_cluster defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step networking defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step definition_import_worker_pool defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.351.0> Starting worker pool 'definition_import_pool' with 8 processes in it 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step cluster_name defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Initialising internal cluster ID to 'rabbitmq-cluster-id-vb7eUVm_pMu4vzxKD3W8-A' 2025-07-30 08:44:59.903 [info] <0.273.0> Running boot step direct_client defined by app rabbit 2025-07-30 08:44:59.903 [info] <0.44.0> Application rabbit started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:45:00.001 [info] <0.699.0> Ready to start client connection listeners 2025-07-30 08:45:00.015 [info] <0.714.0> started TCP listener on [::]:5672 2025-07-30 08:45:00.017 [info] <0.729.0> started TCP listener on 0.0.0.0:5672 2025-07-30 08:45:00.018 [notice] <0.282.0> Changed loghwm of d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log to 5000 2025-07-30 08:45:00.195 [info] <0.699.0> Server startup complete; 0 plugins started. 2025-07-30 08:45:00.195 [info] <0.699.0> Resetting node maintenance status
07-31
【事件触发一致性】研究多智能体网络如何通过分布式事件驱动控制实现有限时间内的共识(Matlab代码实现)内容概要:本文围绕多智能体网络中的事件触发一致性问题,研究如何通过分布式事件驱动控制实现有限时间内的共识,并提供了相应的Matlab代码实现方案。文中探讨了事件触发机制在降低通信负担、提升系统效率方面的优势,重点分析了多智能体系统在有限时间收敛的一致性控制策略,涉及系统模型构建、触发条件设计、稳定性与收敛性分析等核心技术环节。此外,文档还展示了该技术在航空航天、电力系统、机器人协同、无人机编队等多个前沿领域的潜在应用,体现了其跨学科的研究价值和工程实用性。; 适合人群:具备一定控制理论基础和Matlab编程能力的研究生、科研人员及从事自动化、智能系统、多智能体协同控制等相关领域的工程技术人员。; 使用场景及目标:①用于理解和实现多智能体系统在有限时间内达成一致的分布式控制方法;②为事件触发控制、分布式优化、协同控制等课题提供算法设计与仿真验证的技术参考;③支撑科研项目开发、学术论文复现及工程原型系统搭建; 阅读建议:建议结合文中提供的Matlab代码进行实践操作,重点关注事件触发条件的设计逻辑与系统收敛性证明之间的关系,同时可延伸至其他应用场景进行二次开发与性能优化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值